Ver código fonte

清理无用任务

Zhouzhendong 4 anos atrás
pai
commit
3b78698dc4

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

@@ -123,6 +123,14 @@ class TestController extends Controller
     {
         return call_user_func([$this, $method], $request);
     }
+    public function test2(){
+        StationTask::query()->update([
+            "status" => "完成",
+        ]);
+        StationTaskMaterialBox::query()->update([
+            "status" => "完成",
+        ]);
+    }
     public function test1()
     {
         $stations = Station::query()->select("id")->where("parent_id",6);

+ 2 - 2
app/Services/MaterialBoxService.php

@@ -35,9 +35,9 @@ class MaterialBoxService
             $boxes = MaterialBox::query()->select('id',"code")
                 ->whereNotIn("id",$blacklist)
                 ->where("id",">",$id)->where("code","like","IDE%")
-                ->where("status",4)->limit(10)->orderBy("id")
+                ->where("status",4)->limit(50)->orderBy("id")
                 ->whereNotIn("id",StationTaskMaterialBox::query()->select("material_box_id")
-                    ->where("status","!=","完成")->groupBy("material_box_id"));
+                    ->where("status","!=","完成")->groupBy("material_box_id"));
             if ($modelId)$boxes->where("material_box_model_id",$modelId);
             $boxes = $boxes->get();
             if ($boxes->count()==0)break;