正在显示
1 个修改的文件
包含
6 行增加
和
1 行删除
| @@ -339,7 +339,12 @@ class GeoQuestionRes extends Command | @@ -339,7 +339,12 @@ 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::where('status', GeoQuestion::STATUS_OPEN)->where('next_time', '<=', date('Y-m-d'))->orderBy('next_time', 'asc')->groupBy('project_id')->pluck('project_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'); | ||
| 343 | if(!empty($project_ids)){ | 348 | if(!empty($project_ids)){ |
| 344 | foreach ($project_ids as $project_id){ | 349 | foreach ($project_ids as $project_id){ |
| 345 | $ids = GeoQuestion::where(['project_id' => $project_id, 'status' => GeoQuestion::STATUS_OPEN])->where('next_time', '<=', date('Y-m-d'))->pluck('id'); | 350 | $ids = GeoQuestion::where(['project_id' => $project_id, 'status' => GeoQuestion::STATUS_OPEN])->where('next_time', '<=', date('Y-m-d'))->pluck('id'); |
-
请 注册 或 登录 后发表评论