|
|
@@ -109,16 +109,16 @@ class RelatedSalaryAccounting extends Api
|
|
|
$unionQueries = [];
|
|
|
$columns = ['wgjs_bh1', 'wgjs_bh2', 'wgjs_bh3', 'wgjs_bh4', 'wgjs_bh5', 'wgjs_bh6'];
|
|
|
|
|
|
- foreach ($columns as $index => $column) {
|
|
|
+ foreach ($columns as $index => $column) {
|
|
|
$i = $index + 1;
|
|
|
$query = db('db_wgjs')
|
|
|
->field("
|
|
|
- DATE_FORMAT(wgjs_rq,'%Y.%m.%d') as wgjs_rq,
|
|
|
- $column as wgjs_bh,
|
|
|
- 人事_关联工资设置.关联员工,
|
|
|
- wgjs_js{$i} as wgjs_js,
|
|
|
- wgjs_冲定额{$i} as wgjs_冲定额
|
|
|
- ")
|
|
|
+ DATE_FORMAT(wgjs_rq,'%Y.%m.%d') as wgjs_rq,
|
|
|
+ $column as wgjs_bh,
|
|
|
+ 人事_关联工资设置.关联员工,
|
|
|
+ wgjs_js{$i} as wgjs_js,
|
|
|
+ wgjs_冲定额{$i} as wgjs_冲定额
|
|
|
+ ")
|
|
|
->join('人事_关联工资设置', "人事_关联工资设置.被关联员工 = db_wgjs.{$column} and 人事_关联工资设置.日期 = db_wgjs.wgjs_rq")
|
|
|
->join('人事_基本资料', "人事_基本资料.员工编号 = 人事_关联工资设置.关联员工")
|
|
|
->where([
|
|
|
@@ -132,10 +132,8 @@ class RelatedSalaryAccounting extends Api
|
|
|
}
|
|
|
|
|
|
$sql = implode(' UNION ALL ', $unionQueries);
|
|
|
- halt($sql);
|
|
|
$arr = db()->query($sql);
|
|
|
- halt($arr);
|
|
|
-
|
|
|
+
|
|
|
//wgjs员工每日时长统计
|
|
|
$list = [];
|
|
|
foreach($arr as $v){
|