Browse Source

优化机台日定额可能为0的问题

huangsanjia 1 year ago
parent
commit
74af29c714
1 changed files with 6 additions and 1 deletions
  1. 6 1
      application/api/controller/StaffSalary.php

+ 6 - 1
application/api/controller/StaffSalary.php

@@ -115,7 +115,12 @@ class StaffSalary extends Api
             //核算产量
             $accountingYield = $byThePieceYield + $afterProductionYield;
             //工时占比
-            $manHourRate = number_format($accountingYield / $value['日定额'],4);
+            if ($value['日定额'] > 0){
+                $manHourRate = number_format($accountingYield / $value['日定额'],4);
+            }else{
+                $manHourRate = '0.0000';
+            }
+
             for ($i=1; $i<11; $i++){
                 $bhKey = 'sczl_bh'.$i;
                 $xmKey = 'name'.$i;