Zhouzhendong il y a 4 ans
Parent
commit
75b4f64559

+ 1 - 0
app/Http/Controllers/TestController.php

@@ -143,6 +143,7 @@ class TestController extends Controller
     }
     public function test()
     {
+        app("MaterialBoxService")->checkUsableBox(556);
         $station = Station::query()->with(['pendingStationTask.stationTaskMaterialBoxes.materialBox','storage'=>function($query){
             $query->whereNotNull("material_box_id")->orderByDesc("updated_at");
         }])->where('code', "HAIB2-02-02")->first();

+ 2 - 2
app/Services/MaterialBoxService.php

@@ -103,8 +103,8 @@ sql;
     public function checkUsableBox(int $boxId):bool
     {
         /** @var MaterialBox|\stdClass $box */
-        $box = MaterialBox::query()->find($boxId);
-        if (!$this->getBoxLocation($box->code))return false;
+        //$box = MaterialBox::query()->find($boxId);
+        //if (!$this->getBoxLocation($box->code))return false;
         if (StationTaskMaterialBox::query()->select(DB::raw(1))->where("status","!=",'完成')->where("material_box_id",$boxId)->first())return false;
         return true;
     }