|
...
|
...
|
@@ -337,12 +337,13 @@ class GeoQuestionRes extends Command |
|
|
|
$key = 'geo_task_list';
|
|
|
|
$task_id = Redis::rpop($key);
|
|
|
|
if(empty($task_id)){
|
|
|
|
$questionModel = new GeoQuestion();
|
|
|
|
$ids = $questionModel->selectField(['status'=>$questionModel::STATUS_OPEN,'next_time'=>['<=',date('Y-m-d')]],'id');
|
|
|
|
if(!empty($ids)){
|
|
|
|
foreach ($ids as $id) {
|
|
|
|
Redis::lpush($key, $id);
|
|
|
|
}
|
|
|
|
# TODO 按照项目进行获取, 一个项目当天需要将所有跑完
|
|
|
|
$project_id = GeoQuestion::where('status', GeoQuestion::STATUS_OPEN)->where('next_time', '<=', date('Y-m-d'))->value('project_id');
|
|
|
|
if (empty($project_id))
|
|
|
|
return $task_id;
|
|
|
|
$ids = GeoQuestion::where(['project_id' => $project_id, 'status' => GeoQuestion::STATUS_OPEN])->where('current_time', '<>', date('Y-m-d'))->pluck('id');
|
|
|
|
foreach ($ids as $id) {
|
|
|
|
Redis::lpush($key, $id);
|
|
|
|
}
|
|
|
|
$task_id = Redis::rpop($key);
|
|
|
|
}
|
...
|
...
|
|