作者 lyh

gx

@@ -306,7 +306,7 @@ class BlogCategoryLogic extends BaseLogic @@ -306,7 +306,7 @@ class BlogCategoryLogic extends BaseLogic
306 */ 306 */
307 public function importBlogCategory($project_id,$user_id,$category){ 307 public function importBlogCategory($project_id,$user_id,$category){
308 $return = []; 308 $return = [];
309 - $cate_arr = explode('/',$category); 309 + $cate_arr = explode('^v6sp$',$category);
310 $pid = 0; 310 $pid = 0;
311 foreach ($cate_arr as $v){ 311 foreach ($cate_arr as $v){
312 if($v){ 312 if($v){
@@ -273,6 +273,21 @@ class BlogLogic extends BaseLogic @@ -273,6 +273,21 @@ class BlogLogic extends BaseLogic
273 $img = check_remote_url_down($data[5]) ? CosService::uploadRemote($project_id, 'image_news', $data[5]) : $data[5]; 273 $img = check_remote_url_down($data[5]) ? CosService::uploadRemote($project_id, 'image_news', $data[5]) : $data[5];
274 } 274 }
275 275
  276 + $seo_title = '';
  277 + if($data[6]??''){
  278 + $seo_title = substr(strip_tags($data[6]),0,70);
  279 + }
  280 +
  281 + $seo_keywords = '';
  282 + if($data[7]??''){
  283 + $seo_keywords = substr(strip_tags(str_replace('^v6sp$',',',$data[7])),0,255);
  284 + }
  285 +
  286 + $seo_description = '';
  287 + if($data[8]??''){
  288 + $seo_description = substr(strip_tags($data[8]),0,200);
  289 + }
  290 +
276 $id = $this->model->addReturnId( 291 $id = $this->model->addReturnId(
277 [ 292 [
278 'name' => $data[0], 293 'name' => $data[0],
@@ -280,9 +295,9 @@ class BlogLogic extends BaseLogic @@ -280,9 +295,9 @@ class BlogLogic extends BaseLogic
280 'text' => $text, 295 'text' => $text,
281 'remark' => $data[3] ?? '', 296 'remark' => $data[3] ?? '',
282 'image' => $img, 297 'image' => $img,
283 - 'seo_title' => $data[6] ?? '',  
284 - 'seo_keywords' => $data[7] ?? '',  
285 - 'seo_description' => $data[8] ?? '', 298 + 'seo_title' => $seo_title,
  299 + 'seo_keywords' => $seo_keywords,
  300 + 'seo_description' => $seo_description,
286 'project_id' => $project_id, 301 'project_id' => $project_id,
287 'operator_id' => $user_id, 302 'operator_id' => $user_id,
288 'create_id' => $user_id, 303 'create_id' => $user_id,
@@ -32,7 +32,6 @@ class ImportLogic extends BaseLogic @@ -32,7 +32,6 @@ class ImportLogic extends BaseLogic
32 32
33 $this->param['project_id'] = $this->user['project_id']; 33 $this->param['project_id'] = $this->user['project_id'];
34 $this->param['user_id'] = $this->user['id']; 34 $this->param['user_id'] = $this->user['id'];
35 - $this->param['status'] = 9;  
36 $rs = $this->model->add($this->param); 35 $rs = $this->model->add($this->param);
37 if($rs === false){ 36 if($rs === false){
38 $this->fail('error'); 37 $this->fail('error');
@@ -287,7 +287,7 @@ class NewsCategoryLogic extends BaseLogic @@ -287,7 +287,7 @@ class NewsCategoryLogic extends BaseLogic
287 */ 287 */
288 public function importNewsCategory($project_id,$user_id,$category){ 288 public function importNewsCategory($project_id,$user_id,$category){
289 $return = []; 289 $return = [];
290 - $cate_arr = explode('/',$category); 290 + $cate_arr = explode('^v6sp$',$category);
291 $pid = 0; 291 $pid = 0;
292 foreach ($cate_arr as $v){ 292 foreach ($cate_arr as $v){
293 if($v){ 293 if($v){
@@ -306,6 +306,21 @@ class NewsLogic extends BaseLogic @@ -306,6 +306,21 @@ class NewsLogic extends BaseLogic
306 $img = check_remote_url_down($data[5]) ? CosService::uploadRemote($project_id, 'image_news', $data[5]) : $data[5]; 306 $img = check_remote_url_down($data[5]) ? CosService::uploadRemote($project_id, 'image_news', $data[5]) : $data[5];
307 } 307 }
308 308
  309 + $seo_title = '';
  310 + if($data[6]??''){
  311 + $seo_title = substr(strip_tags($data[6]),0,70);
  312 + }
  313 +
  314 + $seo_keywords = '';
  315 + if($data[7]??''){
  316 + $seo_keywords = substr(strip_tags(str_replace('^v6sp$',',',$data[7])),0,255);
  317 + }
  318 +
  319 + $seo_description = '';
  320 + if($data[8]??''){
  321 + $seo_description = substr(strip_tags($data[8]),0,200);
  322 + }
  323 +
309 $id = $this->model->addReturnId( 324 $id = $this->model->addReturnId(
310 [ 325 [
311 'name' => $data[0], 326 'name' => $data[0],
@@ -313,9 +328,9 @@ class NewsLogic extends BaseLogic @@ -313,9 +328,9 @@ class NewsLogic extends BaseLogic
313 'text' => $text, 328 'text' => $text,
314 'remark' => $data[3] ?? '', 329 'remark' => $data[3] ?? '',
315 'image' => $img, 330 'image' => $img,
316 - 'seo_title' => $data[6] ?? '',  
317 - 'seo_keywords' => $data[7] ?? '',  
318 - 'seo_description' => $data[8] ?? '', 331 + 'seo_title' => $seo_title,
  332 + 'seo_keywords' => $seo_keywords,
  333 + 'seo_description' => $seo_description,
319 'project_id' => $project_id, 334 'project_id' => $project_id,
320 'operator_id' => $user_id, 335 'operator_id' => $user_id,
321 'create_id' => $user_id, 336 'create_id' => $user_id,
@@ -277,7 +277,7 @@ class CategoryLogic extends BaseLogic @@ -277,7 +277,7 @@ class CategoryLogic extends BaseLogic
277 */ 277 */
278 public function importProductCategory($project_id,$category){ 278 public function importProductCategory($project_id,$category){
279 $return = []; 279 $return = [];
280 - $cate_arr = explode('/',$category); 280 + $cate_arr = explode('^v6sp$',$category);
281 $pid = 0; 281 $pid = 0;
282 foreach ($cate_arr as $v){ 282 foreach ($cate_arr as $v){
283 if($v){ 283 if($v){
@@ -619,7 +619,7 @@ class ProductLogic extends BaseLogic @@ -619,7 +619,7 @@ class ProductLogic extends BaseLogic
619 $thumb = ''; 619 $thumb = '';
620 if($data[7]??''){ 620 if($data[7]??''){
621 //处理图片 621 //处理图片
622 - $img_arr = explode(',',$data[7]); 622 + $img_arr = explode('^v6sp$',$data[7]);
623 foreach ($img_arr as $v_img){ 623 foreach ($img_arr as $v_img){
624 if($v_img){ 624 if($v_img){
625 $one_img = check_remote_url_down($v_img) ? CosService::uploadRemote($project_id,'image_product',$v_img) : $v_img; 625 $one_img = check_remote_url_down($v_img) ? CosService::uploadRemote($project_id,'image_product',$v_img) : $v_img;
@@ -682,10 +682,25 @@ class ProductLogic extends BaseLogic @@ -682,10 +682,25 @@ class ProductLogic extends BaseLogic
682 } 682 }
683 683
684 //处理seo 684 //处理seo
  685 + $seo_title = '';
  686 + if($data[8]??''){
  687 + $seo_title = substr(strip_tags($data[8]),0,70);
  688 + }
  689 +
  690 + $seo_keywords = '';
  691 + if($data[9]??''){
  692 + $seo_keywords = substr(strip_tags(str_replace('^v6sp$',',',$data[9])),0,255);
  693 + }
  694 +
  695 + $seo_description = '';
  696 + if($data[10]??''){
  697 + $seo_description = substr(strip_tags($data[10]),0,200);
  698 + }
  699 +
685 $seo_mate = [ 700 $seo_mate = [
686 - 'title' => $data[8]??'',  
687 - 'keyword' => $data[9]??'',  
688 - 'description' => $data[10]??'' 701 + 'title' => $seo_title,
  702 + 'keyword' => $seo_keywords,
  703 + 'description' => $seo_description
689 ]; 704 ];
690 705
691 //处理描述切换栏 706 //处理描述切换栏