作者 lyh
@@ -337,6 +337,7 @@ class ProjectUpdate extends Command @@ -337,6 +337,7 @@ class ProjectUpdate extends Command
337 } 337 }
338 //名称去掉特殊符号 338 //名称去掉特殊符号
339 $item['ttile'] = $this->special2str($item['ttile'] ?? ''); 339 $item['ttile'] = $this->special2str($item['ttile'] ?? '');
  340 + //详情
340 $content = $item['content'] ?? ''; 341 $content = $item['content'] ?? '';
341 try { 342 try {
342 $product = $model->read(['route' => $route], ['id', 'six_read']); 343 $product = $model->read(['route' => $route], ['id', 'six_read']);
@@ -406,21 +407,21 @@ class ProjectUpdate extends Command @@ -406,21 +407,21 @@ class ProjectUpdate extends Command
406 'sort' => $item['sort'] ?? 0, 407 'sort' => $item['sort'] ?? 0,
407 'files' => $files, 408 'files' => $files,
408 ], ['id' => $id]); 409 ], ['id' => $id]);
409 - }  
410 - if(!empty($content)){  
411 - $detailModel = new Detail();  
412 - $detailModel->del(['product_id'=>$id,'column_id'=>1]);  
413 - $data_s = [  
414 - 'product_id'=>$id,  
415 - 'column_id'=>1,  
416 - 'text_type'=>1,  
417 - 'title'=>'product detail',  
418 - 'sort'=>1,  
419 - 'content'=>json_encode(['content'=>$content ?? ''],JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES),  
420 - 'created_at'=>date('Y-m-d H:i:s'),  
421 - 'updated_at'=>date('Y-m-d H:i:s')  
422 - ];  
423 - $detailModel->insert($data_s); 410 + if(!empty($content)){
  411 + $detailModel = new Detail();
  412 + $detailModel->del(['product_id'=>$id,'column_id'=>1]);
  413 + $data_s = [
  414 + 'product_id'=>$id,
  415 + 'column_id'=>1,
  416 + 'text_type'=>1,
  417 + 'title'=>'product detail',
  418 + 'sort'=>1,
  419 + 'content'=>json_encode(['content'=>$content ?? ''],JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES),
  420 + 'created_at'=>date('Y-m-d H:i:s'),
  421 + 'updated_at'=>date('Y-m-d H:i:s')
  422 + ];
  423 + $detailModel->insert($data_s);
  424 + }
424 } 425 }
425 } 426 }
426 if ($six_read) { 427 if ($six_read) {