Explorar el Código

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

huangsanjia hace 1 año
padre
commit
74af29c714
Se han modificado 1 ficheros con 6 adiciones y 1 borrados
  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;