Browse Source

计件工资核算优化

qiuenguang 1 year ago
parent
commit
ce0b17659a
1 changed files with 4 additions and 2 deletions
  1. 4 2
      application/api/controller/StaffSalary.php

+ 4 - 2
application/api/controller/StaffSalary.php

@@ -399,6 +399,7 @@ class StaffSalary extends Api
             ->where($where)
             ->group('a.UniqId')
             ->select();
+//        halt($result);
         foreach ($result as $value){
             for ($i=1;$i<7;$i++){
                 $item = [];
@@ -433,13 +434,13 @@ class StaffSalary extends Api
                         $cl = $value[$clKey];
                     }
                     if ($item['sczl_type'] === '包装'){
-                        $item['班组车头产量'] = $cl * $value[$pgclKey] / $value[$typekey];
+                        $item['班组车头产量'] = $cl * $value[$pgclKey] / (int)$value[$typekey];
                     }else{
                         $item['班组车头产量'] = $cl;
                     }
                     $item['工价系数'] = '0.0000';
                     $item['工序难度系数'] = $value[$jcxsKey];
-                    if ($value[$gxKey] <= 0){
+                    if ((int)$value[$jcxsKey] <= 0){
                         $item['工序难度系数'] = '1.0000';
                     }
                     $item['装版工时'] = '0.00';
@@ -468,6 +469,7 @@ class StaffSalary extends Api
                 }
             }
         }
+//        halt($data);
         // 用于存储bh对应的工时占比总和
         $bhTotals = [];
         // 遍历原始数据