作者 刘锟

Merge remote-tracking branch 'origin/master' into akun

... ... @@ -339,16 +339,16 @@ class GeoQuestionRes extends Command
$key = 'geo_task_list';
$task_id = Redis::rpop($key);
if(empty($task_id)){
//todo::这里需要执行统计一次,统计当前项目当前日期的统计
# TODO 按照项目进行获取, 一个项目当天需要将所有跑完
$project_id = GeoQuestion::where('status', GeoQuestion::STATUS_OPEN)->where('next_time', '<=', date('Y-m-d'))->value('project_id');
if (!empty($project_id)){
$this->project_id = $project_id;
$ids = GeoQuestion::where(['project_id' => $project_id, 'status' => GeoQuestion::STATUS_OPEN])->where('next_time', '<=', date('Y-m-d'))->pluck('id');
foreach ($ids as $id) {
Redis::lpush($key, $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();
if(!empty($project_ids)){
foreach ($project_ids as $project_id){
$ids = GeoQuestion::where(['project_id' => $project_id, 'status' => GeoQuestion::STATUS_OPEN])->where('next_time', '<=', date('Y-m-d'))->pluck('id');
foreach ($ids as $id) {
Redis::lpush($key, $id);
}
$task_id = Redis::rpop($key);
}
$task_id = Redis::rpop($key);
}
}
return $task_id;
... ...
... ... @@ -24,7 +24,7 @@ class AiBlogController extends BaseController
if(isset($this->map['new_title']) && !empty($this->map['new_title'])){
$this->map['new_title'] = ['like', '%'.$this->map['new_title'].'%'];
}
$lists = $aiBlog->lists($this->map,$this->page,$this->row,'id',['id','keyword','new_title','route','image','task_id','status','created_at','updated_at']);
$lists = $aiBlog->lists($this->map,$this->page,$this->row,'id',['id','keyword','new_title','route','image','task_id','status','uuid','created_at','updated_at']);
if(!empty($lists) && !empty($lists['list'])){
foreach ($lists['list'] as $k => $v){
$v['image'] = getImageUrl($v['image']);
... ...
... ... @@ -201,7 +201,7 @@ class TicketUploadDataLogic extends BaseLogic
'title' => $info['text']['title'],
'thumb'=>$thumb,
'gallery'=>$info['text']['image'] ?? [],
'intro'=>$info['text']['remark'],
'intro'=>$info['text']['intro'] ?? '',
'category_id'=>$category_id ?? '',
'keyword_id'=>$keyword_id ?? '',
'status'=>1,
... ...
... ... @@ -187,7 +187,9 @@ class AiBlogLogic extends BaseLogic
}
if(isset($param['id']) && !empty($param['id'])){
$id = $param['id'];
$data['task_id'] = $param['task_id'];
if(!empty($param['task_id'])){
$data['task_id'] = $param['task_id'];
}
if(!isset($param['seo_keyword']) || empty($param['seo_keyword'])){
$ai = "contains keyword {$param['title']} recommend 8 purchaser search keywords, separated by commas";
$text = Gpt::instance()->openai_chat_qqs($ai);
... ... @@ -222,7 +224,7 @@ class AiBlogLogic extends BaseLogic
//todo::更新列表页
shell_exec("php artisan save_ai_blog_list {$this->user['project_id']} > /dev/null 2>&1 &");
}else{
$this->fail('发布失败,请编辑后重新发布');
$this->fail('文章已发布,文章无法同步到列表,请编辑后保存');
}
return $this->success();
}
... ...