作者 lyh
@@ -167,7 +167,7 @@ class UpdateSeoTdk extends Command @@ -167,7 +167,7 @@ class UpdateSeoTdk extends Command
167 $ai_commands = AiCommand::where('is_batch', 1)->select('key', 'scene', 'ai')->get()->toArray(); 167 $ai_commands = AiCommand::where('is_batch', 1)->select('key', 'scene', 'ai')->get()->toArray();
168 $ai_commands = Arr::setValueToKey($ai_commands, 'key'); 168 $ai_commands = Arr::setValueToKey($ai_commands, 'key');
169 foreach ($this->maps as $table => $map) { 169 foreach ($this->maps as $table => $map) {
170 - $update[$table] = ['total_page'=>0, 'title'=>0, 'keyword'=>0, 'des'=>0]; 170 + $update[$table] = ['total_page'=>0, 'title'=>0, 'keyword'=>0, 'des'=>0,'keyword_title'=>0,'keyword_content'=>0];
171 echo date('Y-m-d H:i:s') . '更新--' . $table . ': 项目id' . $project_id . PHP_EOL; 171 echo date('Y-m-d H:i:s') . '更新--' . $table . ': 项目id' . $project_id . PHP_EOL;
172 $list = DB::connection('custom_mysql')->table($table)->select('id')->get(); 172 $list = DB::connection('custom_mysql')->table($table)->select('id')->get();
173 if (!empty($list)) { 173 if (!empty($list)) {
@@ -227,6 +227,12 @@ class UpdateSeoTdk extends Command @@ -227,6 +227,12 @@ class UpdateSeoTdk extends Command
227 if($field == 'seo_description' || $field == 'description' || $field == 'seo_des'){ 227 if($field == 'seo_description' || $field == 'description' || $field == 'seo_des'){
228 $update[$table]['des']++; 228 $update[$table]['des']++;
229 } 229 }
  230 + if($field == 'keyword_title'){
  231 + $update[$table]['keyword_title']++;
  232 + }
  233 + if($field == 'keyword_content'){
  234 + $update[$table]['keyword_content']++;
  235 + }
230 $data[$field] = $this->ai_send($prompt); 236 $data[$field] = $this->ai_send($prompt);
231 } 237 }
232 } else { 238 } else {
@@ -261,6 +267,12 @@ class UpdateSeoTdk extends Command @@ -261,6 +267,12 @@ class UpdateSeoTdk extends Command
261 if($field == 'seo_description' || $field == 'description' || $field == 'seo_des'){ 267 if($field == 'seo_description' || $field == 'description' || $field == 'seo_des'){
262 $update[$table]['des']++; 268 $update[$table]['des']++;
263 } 269 }
  270 + if($field == 'keyword_title'){
  271 + $update[$table]['keyword_title']++;
  272 + }
  273 + if($field == 'keyword_content'){
  274 + $update[$table]['keyword_content']++;
  275 + }
264 } 276 }
265 } 277 }
266 } 278 }
@@ -807,6 +807,10 @@ class ProjectController extends BaseController @@ -807,6 +807,10 @@ class ProjectController extends BaseController
807 ', title更新数:'.$item[$k]['title']. 807 ', title更新数:'.$item[$k]['title'].
808 ',keyword更新数据:'.$item[$k]['keyword']. 808 ',keyword更新数据:'.$item[$k]['keyword'].
809 ',des更新数据:'.$item[$k]['des']; 809 ',des更新数据:'.$item[$k]['des'];
  810 + if($k == 'gl_product_keyword'){
  811 + $item[$k] .= ',keyword_title更新数据:'.($item[$k]['keyword_title']??0);
  812 + $item[$k] .= ',keyword_content更新数据:'.($item[$k]['keyword_content']??0);
  813 + }
810 } 814 }
811 815
812 } 816 }