Zhouzhendong 6 лет назад
Родитель
Сommit
e5bc6423c4

+ 7 - 11
app/Http/Controllers/TestController.php

@@ -297,17 +297,13 @@ class TestController extends Controller
     }
     function test5(){
 
-        $MAX_VALUE=2147483647;
-        $MIN_VALUE=-2147483648;
-        $x=123;
-        $sum=0;
-        while (true){
-            $sum=$sum*10+($x%10);
+        $x=10;
+        $s=0;
+        if ($x<0 || ($x%10 == 0 && $x!=0))dd(false);
+        while($x>$s){
+            $s=$s*10+($x%10);
             $x=intval($x/10);
-            if (($sum>intval($MAX_VALUE/10)&&$x!=0)||($sum==intval($MAX_VALUE/10)&&$x>7))return 0;
-            if (($sum<intval($MIN_VALUE/10)&&$x!=0)||($sum==intval($MIN_VALUE/10)&&$x<-8))return 0;
-            if ($x==0)break;
-        };
-        dd();
+        }
+        dd($x==$s || $x==intval($s/10));
     }
 }

+ 3 - 3
app/Http/Controllers/api/thirdPart/flux/WaybillController.php

@@ -82,12 +82,12 @@ class WaybillController extends Controller
             if (isset($warehouseWeight)){
                 $waybill->warehouse_weight=$warehouseWeight;
                 $unit=Unit::where('name','m³')->first();
-                if ($unit)$waybill->warehouse_weight_unit=$unit->id;
+                if ($unit)$waybill->warehouse_weight_unit_id=$unit->id;
             }
             if (isset($warehouseWeightOther)){
                 $waybill->warehouse_weight_other=$warehouseWeightOther;
                 $unit=Unit::where('name','kg')->first();
-                if ($unit)$waybill->warehouse_weight_unit_other=$unit->id;
+                if ($unit)$waybill->warehouse_weight_unit_other_id=$unit->id;
             }
             $waybill->save();
             if ($waybill->type=='直发车'){
@@ -100,7 +100,7 @@ class WaybillController extends Controller
                 $waybill->update();
             }
             //回传FLUX
-            $this->accomplishToWMS($waybill);
+            //$this->accomplishToWMS($waybill);
         }
         return response()->json(['response'=>['return'=>['returnFlag'=>'1','returnCode'=>'0000','returnDesc'=>'正确接收','resultInfo'=>'']]])
             ->setEncodingOptions(JSON_UNESCAPED_UNICODE);