作者 lyh

变更数据

... ... @@ -354,17 +354,16 @@ class GeoQuestionRes extends Command
if (empty($lock)){
return $task_id;
}
$project_ids = GeoQuestion::where('status', GeoQuestion::STATUS_OPEN)->where('next_time', '<=', date('Y-m-d'))->orderBy('next_time', 'asc')->pluck('project_id')->unique()->values()->toArray();
$project_ids = GeoQuestion::where('status', GeoQuestion::STATUS_OPEN)->where('next_time', '<=', date('Y-m-d'))->pluck('project_id')->unique()->values()->toArray();
if(FALSE == empty($project_ids)){
$ids = GeoQuestion::where('status', GeoQuestion::STATUS_OPEN)
->whereIn('project_id', $project_ids)
->where(function ($query){
$query->where('current_time', '!=', date('Y-m-d'))
->orWhereNull('current_time');
$query->where('next_time', '<=', date('Y-m-d'))
->orWhereNull('next_time');
})
->orderBy('project_id', 'asc')
->orderBy('next_time', 'asc')
->pluck('id');
foreach ($ids as $id) {
Redis::lpush($key, $id);
}
... ...