|
...
|
...
|
@@ -91,9 +91,20 @@ DSE1504F,Super fast Recovery Rectifier,ITO-220AC,400,15,Single Positive,150,1.4, |
|
|
|
'module_id'=>2,
|
|
|
|
];
|
|
|
|
$customModuleCategoryModel = new CustomModuleCategory();
|
|
|
|
$catInfo = $customModuleCategoryModel->read(['name'=>$array1[1]]);
|
|
|
|
if($catInfo !== false){
|
|
|
|
$contentData['category_id'] = $catInfo['id'];
|
|
|
|
if(!empty($array1[1]) && is_array($array1)){
|
|
|
|
$cate_arr = explode('-',$array1);
|
|
|
|
foreach ($cate_arr as $cateV){
|
|
|
|
$catInfo = $customModuleCategoryModel->read(['name'=>$cateV]);
|
|
|
|
if($catInfo !== false){
|
|
|
|
$contentData['category_id'] = ','.$catInfo['id'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$contentData['category_id'] = $contentData['category_id'].',';
|
|
|
|
}else{
|
|
|
|
$catInfo = $customModuleCategoryModel->read(['name'=>$array1]);
|
|
|
|
if($catInfo !== false){
|
|
|
|
$contentData['category_id'] = ','.$catInfo['id'].',';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$customModuleContentModel = new CustomModuleContent();
|
|
|
|
$contentId = $customModuleContentModel->addReturnId($contentData);
|
...
|
...
|
|