Quellcode durchsuchen

修改自动派单功能

dongxiaoqin vor 1 Jahr
Ursprung
Commit
7fd1c59a33
1 geänderte Dateien mit 4 neuen und 2 gelöschten Zeilen
  1. 4 2
      app/common/command/AutomaticDispatch.php

+ 4 - 2
app/common/command/AutomaticDispatch.php

@@ -23,8 +23,8 @@ class AutomaticDispatch extends Command
     //工程师综合评分占比
     protected $comprehensiveRate = 0.55;
 
-    //默认服务时长 300 分钟
-    protected $defaultServiceTime = 300; 
+    //默认服务时长 180 分钟
+    protected $defaultServiceTime = 180; 
 
     protected function configure()
     {
@@ -53,6 +53,7 @@ class AutomaticDispatch extends Command
             // 获取当前时间的前五分钟时间戳
             $fiveMinutesAgo = time() - 120; // 300 秒 = 2 分钟
             $list = ServiceWork::where('work_status',0)
+                        ->where('service_status',0)
                         ->where(function ($query) use ($fiveMinutesAgo) {
                             $query->where('exec_time', 0)->whereOr('exec_time', '<', $fiveMinutesAgo);
                         })
@@ -185,6 +186,7 @@ class AutomaticDispatch extends Command
                 ['master_worker_id','=',$worker['id']],
                 ['work_status','>=',1],
                 ['work_status','<=',5],
+                ['service_status','<',4]
             ])
             ->where(function ($query) use ($appointment_time,$estimated_finish_time) {
                 $query->where('appointment_time', 'between',[$appointment_time, $estimated_finish_time])