|
|
@@ -200,7 +200,7 @@ class EmployeeDailySalary extends Api
|
|
|
->join('人事_基本资料 r','r.员工编号=j.bh')
|
|
|
->group('j.bh,j.sczl_rq')
|
|
|
->where('j.sys_ny',$req['date'])
|
|
|
- // ->where('j.达标定额','<>',0)
|
|
|
+ ->where('j.达标定额','<>',0)
|
|
|
->where(['r.所在部门'=>['like',$req['department'].'%']])
|
|
|
->buildSql();
|
|
|
$arr1 = db()->table($arr1 . ' t')
|
|
|
@@ -226,14 +226,15 @@ class EmployeeDailySalary extends Api
|
|
|
->group('j.bh,j.sczl_rq,j.sczl_gdbh')
|
|
|
->select();
|
|
|
//查询每月有达标定额的天数
|
|
|
- $arr3 = db('绩效工资汇总')->alias('j')
|
|
|
-// ->field('j.bh,j.sczl_rq')
|
|
|
- ->join('人事_基本资料 r','r.员工编号=j.bh')
|
|
|
- ->where('j.sys_ny',$req['date'])
|
|
|
- ->where('j.达标定额','<>',0)
|
|
|
- ->where(['r.所在部门'=>['like',$req['department'].'%']])
|
|
|
- ->group('j.bh,j.sczl_rq')
|
|
|
- ->column('count(j.sczl_rq) as date','j.bh');
|
|
|
+// $arr3 = db('绩效工资汇总')->alias('j')
|
|
|
+//// ->field('j.bh,j.sczl_rq')
|
|
|
+// ->join('人事_基本资料 r','r.员工编号=j.bh')
|
|
|
+// ->where('j.sys_ny',$req['date'])
|
|
|
+// ->where('j.达标定额','<>',0)
|
|
|
+// ->where(['r.所在部门'=>['like',$req['department'].'%']])
|
|
|
+// ->group('j.bh,j.sczl_rq')
|
|
|
+// ->column('count(j.sczl_rq) as date','j.bh');
|
|
|
+// halt($arr3);
|
|
|
//计算每条记录的计时补差
|
|
|
$brr = [];
|
|
|
foreach($arr2 as $v){
|
|
|
@@ -241,7 +242,7 @@ class EmployeeDailySalary extends Api
|
|
|
$yjsss2 = array_key_exists($v['bh'],$res1) ? $res1[$v['bh']]['计时时数'] : 0;
|
|
|
$yjsss = $yjsss1 + $yjsss2;
|
|
|
|
|
|
- $a = $yjsss/$arr3[$v['bh']]/11*0.6*$v['达标定额']*$v['Rate']*0.5/1000*$v['千件工价'];
|
|
|
+ $a = $yjsss/$arr1[$v['bh']]/11*0.6*$v['达标定额']*$v['Rate']*0.5/1000*$v['千件工价'];
|
|
|
|
|
|
if(array_key_exists($v['bh'].'-'.$v['sczl_rq'],$brr)){
|
|
|
$brr[$v['bh'].'-'.$v['sczl_rq']] += $a;
|