作者 lyh

变更数据

@@ -17,6 +17,7 @@ use App\Models\Blog\Blog; @@ -17,6 +17,7 @@ use App\Models\Blog\Blog;
17 use App\Models\Com\WordCountry; 17 use App\Models\Com\WordCountry;
18 use App\Models\CustomModule\CustomModuleContent; 18 use App\Models\CustomModule\CustomModuleContent;
19 use App\Models\GoogleSearch\GoogleCodeCountry; 19 use App\Models\GoogleSearch\GoogleCodeCountry;
  20 +use App\Models\News\News;
20 use App\Models\Product\CategoryRelated; 21 use App\Models\Product\CategoryRelated;
21 use App\Models\Product\Keyword; 22 use App\Models\Product\Keyword;
22 use App\Models\Product\Product; 23 use App\Models\Product\Product;
@@ -68,7 +69,26 @@ class UpdateRoute extends Command @@ -68,7 +69,26 @@ class UpdateRoute extends Command
68 */ 69 */
69 public function handle() 70 public function handle()
70 { 71 {
71 - return $this->_action(); 72 +
  73 + }
  74 +
  75 + /**
  76 + * @remark :更新新闻路由
  77 + * @name :updateNewsRoute
  78 + * @author :lyh
  79 + * @method :post
  80 + * @time :2025/9/19 11:05
  81 + */
  82 + public function updateNewsRoute()
  83 + {
  84 + ProjectServer::useProject(1234);
  85 + $newsModel = new News();
  86 + $lists = $newsModel->list(['status'=>1],'id',['id','url']);
  87 + foreach ($lists as $item) {
  88 + $route = RouteMap::setRoute($item['url'], RouteMap::SOURCE_NEWS, $item['id'],1234);
  89 + $newsModel->edit(['url'=>$route],['id'=>$item['id']]);
  90 + }
  91 + DB::disconnect('custom_mysql');
72 } 92 }
73 93
74 /** 94 /**
@@ -180,6 +180,12 @@ class AiBlogLogic extends BaseLogic @@ -180,6 +180,12 @@ class AiBlogLogic extends BaseLogic
180 if(isset($param['id']) && !empty($param['id'])){ 180 if(isset($param['id']) && !empty($param['id'])){
181 $id = $param['id']; 181 $id = $param['id'];
182 $data['task_id'] = $param['task_id']; 182 $data['task_id'] = $param['task_id'];
  183 + if(empty($param['seo_keyword'])){
  184 + $ai = "contains keyword {$param['title']} recommend 8 purchaser search keywords, separated by commas";
  185 + }
  186 + if(empty($param['seo_description'])){
  187 + $ai = "According to the keyword {keyword}, write a seo meta description show to purchaser within 200 characters";
  188 + }
183 $param['route'] = RouteMap::setRoute($param['route'], RouteMap::SOURCE_AI_BLOG, $id, $this->user['project_id']); 189 $param['route'] = RouteMap::setRoute($param['route'], RouteMap::SOURCE_AI_BLOG, $id, $this->user['project_id']);
184 $this->model->edit($param,['id'=>$param['id']]); 190 $this->model->edit($param,['id'=>$param['id']]);
185 }else{ 191 }else{