作者 lyh

gx复制项目脚本

@@ -82,7 +82,6 @@ class LyhImportTest extends Command @@ -82,7 +82,6 @@ class LyhImportTest extends Command
82 $cateModel = new Category(); 82 $cateModel = new Category();
83 $productModel = new Product(); 83 $productModel = new Product();
84 foreach ($line_of_text as $k => $val){ 84 foreach ($line_of_text as $k => $val){
85 - dd($val);  
86 if($k < 2){ 85 if($k < 2){
87 continue; 86 continue;
88 } 87 }
@@ -98,12 +97,14 @@ class LyhImportTest extends Command @@ -98,12 +97,14 @@ class LyhImportTest extends Command
98 $saveData['category_id'] = $cateInfo['id']; 97 $saveData['category_id'] = $cateInfo['id'];
99 } 98 }
100 } 99 }
101 - if($val[2] ?? ''){  
102 - $cateInfo = $cateModel->read(['seo_title'=>trim($val[0])]);  
103 - if($cateInfo !== false){  
104 - $saveData['category_id'] = $cateInfo['id'];  
105 - }  
106 - } 100 + $saveData['intro'] = $val[2];
  101 + $saveData['content'] = $val[3];
  102 + $seo = ['seo_title'=>$val[5]];
  103 + $saveData['seo_mate'] = json_encode($seo,true);
  104 + $thumb = ['alt'=>'主图','url'=>str_replace('/public','',$val[6])];
  105 + $gallery = [['alt'=>'主图','url'=>str_replace('/public','',$val[6])]];
  106 + $saveData['thumb'] = json_encode($thumb,true);
  107 + $saveData['gallery'] = json_encode($gallery,true);
107 } 108 }
108 } 109 }
109 110
@@ -26,7 +26,7 @@ class UserLogic extends BaseLogic @@ -26,7 +26,7 @@ class UserLogic extends BaseLogic
26 */ 26 */
27 public function user_info() 27 public function user_info()
28 { 28 {
29 - $info = $this->model->read($this->param, ['id', 'project_id', 'name', 'status', 'role_id' ,'mobile', 'operator_id']); 29 + $info = $this->model->read($this->param, ['id', 'project_id', 'name', 'status', 'role_id' ,'mobile', 'is_password' ,'operator_id']);
30 if ($info === false) { 30 if ($info === false) {
31 $this->fail('当前数据不存在'); 31 $this->fail('当前数据不存在');
32 } 32 }