正在显示
1 个修改的文件
包含
7 行增加
和
48 行删除
| @@ -89,13 +89,7 @@ class UpdateSeoTdk extends Command | @@ -89,13 +89,7 @@ class UpdateSeoTdk extends Command | ||
| 89 | $seo_arr = json_decode($v['seo_mate'], true) ?: []; | 89 | $seo_arr = json_decode($v['seo_mate'], true) ?: []; |
| 90 | //更新seo_title | 90 | //更新seo_title |
| 91 | if(!isset($seo_arr['title']) || empty($seo_arr['title'])){ | 91 | if(!isset($seo_arr['title']) || empty($seo_arr['title'])){ |
| 92 | - $setting = DB::connection('custom_mysql')->table('gl_web_setting_seo')->where(['project_id'=>$project_id])->first(); | ||
| 93 | - //生成seo_title | ||
| 94 | - if(!empty($setting['product_prefix']) && !empty($setting['product_suffix'])){ | ||
| 95 | - $seo_arr['title'] = $setting['product_prefix'] . '-' . $seo_arr['title'] . '-' . $setting['product_suffix']; | ||
| 96 | - }else{ | ||
| 97 | - $seo_arr['title'] = $this->ai_send('seo_title',$seo_arr['title']); | ||
| 98 | - } | 92 | + $seo_arr['title'] = $seo_arr['title']; |
| 99 | } | 93 | } |
| 100 | //更新seo_keyword | 94 | //更新seo_keyword |
| 101 | if(!isset($seo_arr['keyword']) || empty($seo_arr['keyword'])){ | 95 | if(!isset($seo_arr['keyword']) || empty($seo_arr['keyword'])){ |
| @@ -127,13 +121,7 @@ class UpdateSeoTdk extends Command | @@ -127,13 +121,7 @@ class UpdateSeoTdk extends Command | ||
| 127 | $v = (array)$v; | 121 | $v = (array)$v; |
| 128 | $data = []; | 122 | $data = []; |
| 129 | if(empty($v['seo_title'])){ | 123 | if(empty($v['seo_title'])){ |
| 130 | - $setting = DB::connection('custom_mysql')->table('gl_web_setting_seo')->where(['project_id'=>$project_id])->first(); | ||
| 131 | - //生成seo_title | ||
| 132 | - if(!empty($setting['product_cate_prefix']) && !empty($setting['product_cate_suffix'])){ | ||
| 133 | - $data['seo_title'] = $setting['product_cate_prefix'] . '-' . $v['title'] . '-' . $setting['product_cate_suffix']; | ||
| 134 | - }else{ | ||
| 135 | - $data['seo_title'] = $this->ai_send('seo_title',$v['title']); | ||
| 136 | - } | 124 | + $data['seo_title'] = $v['title']; |
| 137 | } | 125 | } |
| 138 | if(empty($v['seo_keywords'])){ | 126 | if(empty($v['seo_keywords'])){ |
| 139 | $data['seo_keywords'] = $this->ai_send('seo_keywords',$v['title']); | 127 | $data['seo_keywords'] = $this->ai_send('seo_keywords',$v['title']); |
| @@ -165,13 +153,8 @@ class UpdateSeoTdk extends Command | @@ -165,13 +153,8 @@ class UpdateSeoTdk extends Command | ||
| 165 | $v = (array)$v; | 153 | $v = (array)$v; |
| 166 | $data = []; | 154 | $data = []; |
| 167 | if(empty($v['seo_title'])){ | 155 | if(empty($v['seo_title'])){ |
| 168 | - $setting = DB::connection('custom_mysql')->table('gl_web_setting_seo')->where(['project_id'=>$project_id])->first(); | ||
| 169 | //生成seo_title | 156 | //生成seo_title |
| 170 | - if(!empty($setting['single_page_suffix'])){ | ||
| 171 | - $data['seo_title'] = $v['name'] . '-' . $setting['single_page_suffix']; | ||
| 172 | - }else{ | ||
| 173 | - $data['seo_title'] = $this->ai_send('seo_title',$v['name']); | ||
| 174 | - } | 157 | + $data['seo_title'] = $v['name']; |
| 175 | } | 158 | } |
| 176 | if(empty($v['seo_keywords'])){ | 159 | if(empty($v['seo_keywords'])){ |
| 177 | $data['seo_keywords'] = $this->ai_send('seo_keywords',$v['name']); | 160 | $data['seo_keywords'] = $this->ai_send('seo_keywords',$v['name']); |
| @@ -202,13 +185,7 @@ class UpdateSeoTdk extends Command | @@ -202,13 +185,7 @@ class UpdateSeoTdk extends Command | ||
| 202 | $v = (array)$v; | 185 | $v = (array)$v; |
| 203 | $data = []; | 186 | $data = []; |
| 204 | if(empty($v['seo_title'])){ | 187 | if(empty($v['seo_title'])){ |
| 205 | - $setting = DB::connection('custom_mysql')->table('gl_web_setting_seo')->where(['project_id'=>$project_id])->first(); | ||
| 206 | - //生成seo_title | ||
| 207 | - if(!empty($setting['single_page_suffix'])){ | ||
| 208 | - $data['seo_title'] = $v['name'] . '-' . $setting['single_page_suffix']; | ||
| 209 | - }else{ | ||
| 210 | - $data['seo_title'] = $this->ai_send('seo_title',$v['name']); | ||
| 211 | - } | 188 | + $data['seo_title'] = $v['name']; |
| 212 | } | 189 | } |
| 213 | if(empty($v['seo_keywords'])){ | 190 | if(empty($v['seo_keywords'])){ |
| 214 | $data['seo_keywords'] = $this->ai_send('seo_keywords',$v['name']); | 191 | $data['seo_keywords'] = $this->ai_send('seo_keywords',$v['name']); |
| @@ -240,13 +217,8 @@ class UpdateSeoTdk extends Command | @@ -240,13 +217,8 @@ class UpdateSeoTdk extends Command | ||
| 240 | $v = (array)$v; | 217 | $v = (array)$v; |
| 241 | $data = []; | 218 | $data = []; |
| 242 | if(empty($v['seo_title'])){ | 219 | if(empty($v['seo_title'])){ |
| 243 | - $setting = DB::connection('custom_mysql')->table('gl_web_setting_seo')->where(['project_id'=>$project_id])->first(); | ||
| 244 | //生成seo_title | 220 | //生成seo_title |
| 245 | - if(!empty($setting['single_page_suffix'])){ | ||
| 246 | - $data['seo_title'] = $v['name'] . '-' . $setting['single_page_suffix']; | ||
| 247 | - }else{ | ||
| 248 | - $data['seo_title'] = $this->ai_send('seo_title',$v['name']); | ||
| 249 | - } | 221 | + $data['seo_title'] = $v['name']; |
| 250 | } | 222 | } |
| 251 | if(empty($v['seo_keywords'])){ | 223 | if(empty($v['seo_keywords'])){ |
| 252 | $data['seo_keywords'] = $this->ai_send('seo_keywords',$v['name']); | 224 | $data['seo_keywords'] = $this->ai_send('seo_keywords',$v['name']); |
| @@ -277,13 +249,7 @@ class UpdateSeoTdk extends Command | @@ -277,13 +249,7 @@ class UpdateSeoTdk extends Command | ||
| 277 | $v = (array)$v; | 249 | $v = (array)$v; |
| 278 | $data = []; | 250 | $data = []; |
| 279 | if(empty($v['seo_title'])){ | 251 | if(empty($v['seo_title'])){ |
| 280 | - $setting = DB::connection('custom_mysql')->table('gl_web_setting_seo')->where(['project_id'=>$project_id])->first(); | ||
| 281 | - //生成seo_title | ||
| 282 | - if(!empty($setting['single_page_suffix'])){ | ||
| 283 | - $data['seo_title'] = $v['name'] . '-' . $setting['single_page_suffix']; | ||
| 284 | - }else{ | ||
| 285 | - $data['seo_title'] = $this->ai_send('seo_title',$v['name']); | ||
| 286 | - } | 252 | + $data['seo_title'] = $v['name']; |
| 287 | } | 253 | } |
| 288 | if(empty($v['seo_keywords'])){ | 254 | if(empty($v['seo_keywords'])){ |
| 289 | $data['seo_keywords'] = $this->ai_send('seo_keywords',$v['name']); | 255 | $data['seo_keywords'] = $this->ai_send('seo_keywords',$v['name']); |
| @@ -315,21 +281,14 @@ class UpdateSeoTdk extends Command | @@ -315,21 +281,14 @@ class UpdateSeoTdk extends Command | ||
| 315 | $v = (array)$v; | 281 | $v = (array)$v; |
| 316 | $data = []; | 282 | $data = []; |
| 317 | if(empty($v['seo_title'])){ | 283 | if(empty($v['seo_title'])){ |
| 318 | - $setting = DB::connection('custom_mysql')->table('gl_web_setting_seo')->where(['project_id'=>$project_id])->first(); | ||
| 319 | //生成seo_title | 284 | //生成seo_title |
| 320 | - if(!empty($setting['single_page_suffix'])){ | ||
| 321 | - $data['title'] = $v['title'] . '-' . $setting['single_page_suffix']; | ||
| 322 | - }else{ | ||
| 323 | - $data['title'] = $this->ai_send('seo_title',$v['title']); | ||
| 324 | - } | 285 | + $data['title'] = $v['title']; |
| 325 | } | 286 | } |
| 326 | if(empty($v['keywords'])){ | 287 | if(empty($v['keywords'])){ |
| 327 | //获取核心关键词 | 288 | //获取核心关键词 |
| 328 | $main_keyword = $this->mainKeywords($project_id); | 289 | $main_keyword = $this->mainKeywords($project_id); |
| 329 | if(!empty($main_keyword)){ | 290 | if(!empty($main_keyword)){ |
| 330 | $data['keywords'] = $this->ai_send('seo_keywords',$main_keyword); | 291 | $data['keywords'] = $this->ai_send('seo_keywords',$main_keyword); |
| 331 | - }else{ | ||
| 332 | - $data['keywords'] = $this->ai_send('seo_keywords',$v['title']); | ||
| 333 | } | 292 | } |
| 334 | } | 293 | } |
| 335 | if(empty($v['description'])){ | 294 | if(empty($v['description'])){ |
-
请 注册 或 登录 后发表评论