|
...
|
...
|
@@ -44,7 +44,7 @@ class UpdateController extends BaseController |
|
|
|
*/
|
|
|
|
public function updateProduct(){
|
|
|
|
$productModel = new Product();
|
|
|
|
$list = $productModel->list(['status'=>Product::STATUS_ON,'project_id'=>$this->user['project_id'],'deleted_at'=>null]);
|
|
|
|
$list = $productModel->list(['status'=>Product::STATUS_ON,'project_id'=>$this->user['project_id']],'id',['id','seo_mate']);
|
|
|
|
if(!empty($list)){
|
|
|
|
foreach ($list as $k => $v){
|
|
|
|
if(!empty($v['seo_mate'])){
|
|
...
|
...
|
@@ -52,19 +52,24 @@ class UpdateController extends BaseController |
|
|
|
//更新seo_title
|
|
|
|
if(!isset($seo_arr['title'])){
|
|
|
|
//生成seo_title
|
|
|
|
$seo_arr['title'] = Com;
|
|
|
|
$seo_arr['title'] = $this->ai_send('product_seo_title',$v['title']);
|
|
|
|
var_dump($seo_arr);
|
|
|
|
die();
|
|
|
|
}
|
|
|
|
//更新seo_keyword
|
|
|
|
if(!isset($seo_arr['keyword'])){
|
|
|
|
$seo_arr['keyword'] = 1;
|
|
|
|
$seo_arr['keyword'] = $this->ai_send('product_seo_keyword',$v['title']);
|
|
|
|
}
|
|
|
|
//更新seo_keyword
|
|
|
|
if(!isset($seo_arr['description'])){
|
|
|
|
$seo_arr['description'] = 1;
|
|
|
|
$seo_arr['description'] = $this->ai_send('product_seo_description',$v['title']);;
|
|
|
|
}
|
|
|
|
$ser_str = json_decode($seo_arr);
|
|
|
|
$productModel->edit(['seo_mate'=>$ser_str],['id'=>$v['id']]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
...
|
...
|
@@ -115,6 +120,6 @@ class UpdateController extends BaseController |
|
|
|
'keywords'=>$keywords,
|
|
|
|
];
|
|
|
|
$data = Common::send_openai_msg($chat_url,$param);
|
|
|
|
|
|
|
|
return $data;
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|