作者 lyh

gxAiblog自动发布

@@ -56,12 +56,12 @@ class lyhDemo extends Command @@ -56,12 +56,12 @@ class lyhDemo extends Command
56 echo date('Y-m-d H:i:s') . '开始--项目的id:'. $val['id'] . PHP_EOL; 56 echo date('Y-m-d H:i:s') . '开始--项目的id:'. $val['id'] . PHP_EOL;
57 ProjectServer::useProject($val['id']); 57 ProjectServer::useProject($val['id']);
58 $aiBlogModel = new AiBlog(); 58 $aiBlogModel = new AiBlog();
59 - $aiLists = $aiBlogModel->list(['status'=>2]); 59 + $aiLists = $aiBlogModel->list(['status'=>2],'id',['seo_description']);
60 if(!empty($aiLists)){ 60 if(!empty($aiLists)){
61 foreach ($aiLists as $item){ 61 foreach ($aiLists as $item){
62 if(!empty($item['seo_description'])){ 62 if(!empty($item['seo_description'])){
63 $text = $this->trimToLastFullWord($item['seo_description']); 63 $text = $this->trimToLastFullWord($item['seo_description']);
64 - echo $text.PHP_EOL; 64 + $aiBlogModel->edit(['seo_description'=>$text],['id'=>$item['id']]);
65 } 65 }
66 } 66 }
67 } 67 }