Prechádzať zdrojové kódy

运输管理--仓库计重手动刷新修改

haozi 5 rokov pred
rodič
commit
38e32c134d

+ 8 - 4
app/Http/Controllers/WaybillController.php

@@ -880,10 +880,14 @@ class WaybillController extends Controller
         }
         $warehouseWeight=round($warehouseWeight,2);
         $waybill=Waybill::where('wms_bill_number',$wms_bill_number)->first();
-        if ($waybill['warehouse_weight_other']!=$warehouseWeight){
-            $waybill['warehouse_weight_other']=$warehouseWeight;
-            $waybill->update();
-            $this->log(__METHOD__,'刷新仓库计重'.__FUNCTION__,json_encode($request->toArray()),Auth::user()['id']);
+        if ($warehouseWeight!=0){
+            if ($waybill['warehouse_weight_other']!=$warehouseWeight){
+                $waybill['warehouse_weight_other']=$warehouseWeight;
+                $waybill->update();
+                $this->log(__METHOD__,'刷新仓库计重'.__FUNCTION__,json_encode($request->toArray()),Auth::user()['id']);
+            }
+        }else{
+            $warehouseWeight=$waybill['warehouse_weight_other'];
         }
         return ['success'=>true,'warehouseWeight'=>$warehouseWeight];
     }