|
...
|
...
|
@@ -86,13 +86,7 @@ class UpdateSeoTdk extends Command |
|
|
|
$seo_arr = json_decode($v['seo_mate'], true) ?: [];
|
|
|
|
//更新seo_title
|
|
|
|
if(!isset($seo_arr['title']) || empty($seo_arr['title'])){
|
|
|
|
$setting = DB::connection('custom_mysql')->table('gl_web_setting_seo')->where(['project_id'=>$project_id])->first();
|
|
|
|
//生成seo_title
|
|
|
|
if(!empty($setting['product_prefix']) && !empty($setting['product_suffix'])){
|
|
|
|
$seo_arr['title'] = $setting['product_prefix'] . '-' . $seo_arr['title'] . '-' . $setting['product_suffix'];
|
|
|
|
}else{
|
|
|
|
$seo_arr['title'] = $this->ai_send('seo_title',$seo_arr['title']);
|
|
|
|
}
|
|
|
|
$seo_arr['title'] = $seo_arr['title'];
|
|
|
|
}
|
|
|
|
//更新seo_keyword
|
|
|
|
if(!isset($seo_arr['keyword']) || empty($seo_arr['keyword'])){
|
|
...
|
...
|
@@ -124,13 +118,7 @@ class UpdateSeoTdk extends Command |
|
|
|
$v = (array)$v;
|
|
|
|
$data = [];
|
|
|
|
if(empty($v['seo_title'])){
|
|
|
|
$setting = DB::connection('custom_mysql')->table('gl_web_setting_seo')->where(['project_id'=>$project_id])->first();
|
|
|
|
//生成seo_title
|
|
|
|
if(!empty($setting['product_cate_prefix']) && !empty($setting['product_cate_suffix'])){
|
|
|
|
$data['seo_title'] = $setting['product_cate_prefix'] . '-' . $v['title'] . '-' . $setting['product_cate_suffix'];
|
|
|
|
}else{
|
|
|
|
$data['seo_title'] = $this->ai_send('seo_title',$v['title']);
|
|
|
|
}
|
|
|
|
$data['seo_title'] = $v['title'];
|
|
|
|
}
|
|
|
|
if(empty($v['seo_keywords'])){
|
|
|
|
$data['seo_keywords'] = $this->ai_send('seo_keywords',$v['title']);
|
|
...
|
...
|
@@ -162,13 +150,8 @@ class UpdateSeoTdk extends Command |
|
|
|
$v = (array)$v;
|
|
|
|
$data = [];
|
|
|
|
if(empty($v['seo_title'])){
|
|
|
|
$setting = DB::connection('custom_mysql')->table('gl_web_setting_seo')->where(['project_id'=>$project_id])->first();
|
|
|
|
//生成seo_title
|
|
|
|
if(!empty($setting['single_page_suffix'])){
|
|
|
|
$data['seo_title'] = $v['name'] . '-' . $setting['single_page_suffix'];
|
|
|
|
}else{
|
|
|
|
$data['seo_title'] = $this->ai_send('seo_title',$v['name']);
|
|
|
|
}
|
|
|
|
$data['seo_title'] = $v['name'];
|
|
|
|
}
|
|
|
|
if(empty($v['seo_keywords'])){
|
|
|
|
$data['seo_keywords'] = $this->ai_send('seo_keywords',$v['name']);
|
|
...
|
...
|
@@ -199,13 +182,7 @@ class UpdateSeoTdk extends Command |
|
|
|
$v = (array)$v;
|
|
|
|
$data = [];
|
|
|
|
if(empty($v['seo_title'])){
|
|
|
|
$setting = DB::connection('custom_mysql')->table('gl_web_setting_seo')->where(['project_id'=>$project_id])->first();
|
|
|
|
//生成seo_title
|
|
|
|
if(!empty($setting['single_page_suffix'])){
|
|
|
|
$data['seo_title'] = $v['name'] . '-' . $setting['single_page_suffix'];
|
|
|
|
}else{
|
|
|
|
$data['seo_title'] = $this->ai_send('seo_title',$v['name']);
|
|
|
|
}
|
|
|
|
$data['seo_title'] = $v['name'];
|
|
|
|
}
|
|
|
|
if(empty($v['seo_keywords'])){
|
|
|
|
$data['seo_keywords'] = $this->ai_send('seo_keywords',$v['name']);
|
|
...
|
...
|
@@ -237,13 +214,8 @@ class UpdateSeoTdk extends Command |
|
|
|
$v = (array)$v;
|
|
|
|
$data = [];
|
|
|
|
if(empty($v['seo_title'])){
|
|
|
|
$setting = DB::connection('custom_mysql')->table('gl_web_setting_seo')->where(['project_id'=>$project_id])->first();
|
|
|
|
//生成seo_title
|
|
|
|
if(!empty($setting['single_page_suffix'])){
|
|
|
|
$data['seo_title'] = $v['name'] . '-' . $setting['single_page_suffix'];
|
|
|
|
}else{
|
|
|
|
$data['seo_title'] = $this->ai_send('seo_title',$v['name']);
|
|
|
|
}
|
|
|
|
$data['seo_title'] = $v['name'];
|
|
|
|
}
|
|
|
|
if(empty($v['seo_keywords'])){
|
|
|
|
$data['seo_keywords'] = $this->ai_send('seo_keywords',$v['name']);
|
|
...
|
...
|
@@ -274,13 +246,7 @@ class UpdateSeoTdk extends Command |
|
|
|
$v = (array)$v;
|
|
|
|
$data = [];
|
|
|
|
if(empty($v['seo_title'])){
|
|
|
|
$setting = DB::connection('custom_mysql')->table('gl_web_setting_seo')->where(['project_id'=>$project_id])->first();
|
|
|
|
//生成seo_title
|
|
|
|
if(!empty($setting['single_page_suffix'])){
|
|
|
|
$data['seo_title'] = $v['name'] . '-' . $setting['single_page_suffix'];
|
|
|
|
}else{
|
|
|
|
$data['seo_title'] = $this->ai_send('seo_title',$v['name']);
|
|
|
|
}
|
|
|
|
$data['seo_title'] = $v['name'];
|
|
|
|
}
|
|
|
|
if(empty($v['seo_keywords'])){
|
|
|
|
$data['seo_keywords'] = $this->ai_send('seo_keywords',$v['name']);
|
|
...
|
...
|
@@ -312,21 +278,14 @@ class UpdateSeoTdk extends Command |
|
|
|
$v = (array)$v;
|
|
|
|
$data = [];
|
|
|
|
if(empty($v['seo_title'])){
|
|
|
|
$setting = DB::connection('custom_mysql')->table('gl_web_setting_seo')->where(['project_id'=>$project_id])->first();
|
|
|
|
//生成seo_title
|
|
|
|
if(!empty($setting['single_page_suffix'])){
|
|
|
|
$data['title'] = $v['title'] . '-' . $setting['single_page_suffix'];
|
|
|
|
}else{
|
|
|
|
$data['title'] = $this->ai_send('seo_title',$v['title']);
|
|
|
|
}
|
|
|
|
$data['title'] = $v['title'];
|
|
|
|
}
|
|
|
|
if(empty($v['keywords'])){
|
|
|
|
//获取核心关键词
|
|
|
|
$main_keyword = $this->mainKeywords($project_id);
|
|
|
|
if(!empty($main_keyword)){
|
|
|
|
$data['keywords'] = $this->ai_send('seo_keywords',$main_keyword);
|
|
|
|
}else{
|
|
|
|
$data['keywords'] = $this->ai_send('seo_keywords',$v['title']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(empty($v['description'])){
|
...
|
...
|
|