作者 lyh

gx脚本

@@ -1300,15 +1300,14 @@ MBR60L100PT,Rectifier/Schottky Barrier Rectifier,TO-247AD,Common Cathode,100,60, @@ -1300,15 +1300,14 @@ MBR60L100PT,Rectifier/Schottky Barrier Rectifier,TO-247AD,Common Cathode,100,60,
1300 $contentId, $project_id); 1300 $contentId, $project_id);
1301 $customContentModel->edit(['route'=>$route],['id'=>$contentId]); 1301 $customContentModel->edit(['route'=>$route],['id'=>$contentId]);
1302 if(!empty($array[1])){ 1302 if(!empty($array[1])){
  1303 + $categoryId = ',';
1303 $cateArr = explode('/',$array[1]); 1304 $cateArr = explode('/',$array[1]);
1304 foreach ($cateArr as $cateV){ 1305 foreach ($cateArr as $cateV){
1305 - $categoryId = ',';  
1306 $cateInfo = $customCategoryModel->read(['name'=>$cateV,'module_id'=>2,'project_id'=>$project_id]); 1306 $cateInfo = $customCategoryModel->read(['name'=>$cateV,'module_id'=>2,'project_id'=>$project_id]);
1307 if($cateInfo !== false){ 1307 if($cateInfo !== false){
1308 $categoryId .= $cateInfo['id'].','; 1308 $categoryId .= $cateInfo['id'].',';
1309 } 1309 }
1310 } 1310 }
1311 - $categoryId = trim($categoryId,',');  
1312 $customContentModel->edit(['category_id'=>$categoryId],['id'=>$contentId]); 1311 $customContentModel->edit(['category_id'=>$categoryId],['id'=>$contentId]);
1313 } 1312 }
1314 $saveData = [ 1313 $saveData = [