正在显示
1 个修改的文件
包含
3 行增加
和
2 行删除
| @@ -92,14 +92,15 @@ DSE1504F,Rectifier/Super fast Recovery Rectifier,ITO-220AC,400,15,Single Positiv | @@ -92,14 +92,15 @@ DSE1504F,Rectifier/Super fast Recovery Rectifier,ITO-220AC,400,15,Single Positiv | ||
| 92 | ]; | 92 | ]; |
| 93 | $customModuleCategoryModel = new CustomModuleCategory(); | 93 | $customModuleCategoryModel = new CustomModuleCategory(); |
| 94 | if(!empty($array1[1])){ | 94 | if(!empty($array1[1])){ |
| 95 | + $cate_ids = ''; | ||
| 95 | $cate_arr = explode('/',$array1[1]); | 96 | $cate_arr = explode('/',$array1[1]); |
| 96 | foreach ($cate_arr as $cateV){ | 97 | foreach ($cate_arr as $cateV){ |
| 97 | $catInfo = $customModuleCategoryModel->read(['name'=>$cateV]); | 98 | $catInfo = $customModuleCategoryModel->read(['name'=>$cateV]); |
| 98 | if($catInfo !== false){ | 99 | if($catInfo !== false){ |
| 99 | - $contentData['category_id'] = ','.$catInfo['id']; | 100 | + $cate_ids = ','.$catInfo['id']; |
| 100 | } | 101 | } |
| 101 | } | 102 | } |
| 102 | - $contentData['category_id'] = $contentData['category_id'].','; | 103 | + $contentData['category_id'] = empty($cate_ids) ? '' : $cate_ids.','; |
| 103 | }else{ | 104 | }else{ |
| 104 | $catInfo = $customModuleCategoryModel->read(['name'=>$array1[1]]); | 105 | $catInfo = $customModuleCategoryModel->read(['name'=>$array1[1]]); |
| 105 | if($catInfo !== false){ | 106 | if($catInfo !== false){ |
-
请 注册 或 登录 后发表评论