作者 lyh

变更数据

@@ -339,12 +339,8 @@ class GeoQuestionRes extends Command @@ -339,12 +339,8 @@ class GeoQuestionRes extends Command
339 $key = 'geo_task_list'; 339 $key = 'geo_task_list';
340 $task_id = Redis::rpop($key); 340 $task_id = Redis::rpop($key);
341 if(empty($task_id)){ 341 if(empty($task_id)){
342 - $project_ids = GeoQuestion::select('project_id', DB::raw('MIN(next_time) as min_time'))  
343 - ->where('status', GeoQuestion::STATUS_OPEN)  
344 - ->where('next_time', '<=', date('Y-m-d'))  
345 - ->groupBy('project_id')  
346 - ->orderBy('min_time', 'asc')  
347 - ->pluck('project_id'); 342 + $project_ids = GeoQuestion::where('status', GeoQuestion::STATUS_OPEN)->where('next_time', '<=', date('Y-m-d'))
  343 + ->orderBy('next_time', 'asc')->pluck('project_id')->unique()->values()->toArray();
348 if(!empty($project_ids)){ 344 if(!empty($project_ids)){
349 foreach ($project_ids as $project_id){ 345 foreach ($project_ids as $project_id){
350 $ids = GeoQuestion::where(['project_id' => $project_id, 'status' => GeoQuestion::STATUS_OPEN])->where('next_time', '<=', date('Y-m-d'))->pluck('id'); 346 $ids = GeoQuestion::where(['project_id' => $project_id, 'status' => GeoQuestion::STATUS_OPEN])->where('next_time', '<=', date('Y-m-d'))->pluck('id');