|
@@ -616,10 +616,13 @@ class ProductLogic extends BaseLogic |
|
@@ -616,10 +616,13 @@ class ProductLogic extends BaseLogic |
|
616
|
if (!$product) {
|
616
|
if (!$product) {
|
|
617
|
|
617
|
|
|
618
|
$category_id = '';
|
618
|
$category_id = '';
|
|
|
|
619
|
+ $category_arr = [];
|
|
619
|
if ($data[2]??'') {
|
620
|
if ($data[2]??'') {
|
|
620
|
//处理分类
|
621
|
//处理分类
|
|
621
|
$categoryLogic = new CategoryLogic();
|
622
|
$categoryLogic = new CategoryLogic();
|
|
622
|
- $category_id = $categoryLogic->importProductCategory($project_id, $data[2]);
|
623
|
+ $category_info = $categoryLogic->importProductCategory($project_id, $data[2]);
|
|
|
|
624
|
+ $category_id = $category_info['category_id'];
|
|
|
|
625
|
+ $category_arr = $category_info['category_arr'];
|
|
623
|
}
|
626
|
}
|
|
624
|
|
627
|
|
|
625
|
$keyword_id = '';
|
628
|
$keyword_id = '';
|
|
@@ -805,6 +808,11 @@ class ProductLogic extends BaseLogic |
|
@@ -805,6 +808,11 @@ class ProductLogic extends BaseLogic |
|
805
|
|
808
|
|
|
806
|
$this->edit(['route' => $route], ['id' => $id]);
|
809
|
$this->edit(['route' => $route], ['id' => $id]);
|
|
807
|
|
810
|
|
|
|
|
811
|
+ //关联分类
|
|
|
|
812
|
+ if($category_arr){
|
|
|
|
813
|
+ CategoryRelated::saveRelated($id, $category_arr);
|
|
|
|
814
|
+ }
|
|
|
|
815
|
+
|
|
808
|
return true;
|
816
|
return true;
|
|
809
|
}
|
817
|
}
|
|
810
|
|
818
|
|