shish 2 éve
szülő
commit
b0ff2933f0

+ 2 - 2
app-ghs/controllers/CpController.php

@@ -23,8 +23,8 @@ class CpController extends BaseController
         if (empty($ptCp)) {
             util::fail('没有找到产品');
         }
-        CpService::addPtCp($ptCp, $this->shop);
-        util::success(['info' => []]);
+        $cp = CpService::addPtCp($ptCp, $this->shop);
+        util::success(['cp' => $cp]);
     }
 
     //根据分类id取集合,带分页 ssh 20231228

+ 2 - 1
biz-ghs/cp/classes/CpClass.php

@@ -56,6 +56,7 @@ class CpClass extends BaseClass
             unset($arr['classId']);
             $arr['ptCpId'] = $ptCpId;
             $arr['classId'] = $currentClassId;
+            $arr['mainId'] = $mainId;
             $shopCp = self::addCp($arr, $currentShop);
         }
         if ($ptCp->auth == 0) {
@@ -110,7 +111,7 @@ class CpClass extends BaseClass
                 CpItemClass::add($currentData, true);
             }
         }
-
+        return $shopCp;
     }
 
     //恢复产品 ssh 20240222

+ 2 - 1
biz-ghs/cp/services/CpService.php

@@ -14,7 +14,7 @@ class CpService extends BaseService
     //从平台导入产品 ssh 20240227
     public static function addPtCp($ptCp, $currentShop)
     {
-        CpClass::importPtCp($ptCp, $currentShop);
+        $shopCp = CpClass::importPtCp($ptCp, $currentShop);
         if (isset($currentShop->default) && $currentShop->default == 1) {
             $sjId = $currentShop->sjId ?? 0;
             $shopList = ShopClass::getAllByCondition(['sjId' => $sjId], null, '*', null, true);
@@ -26,6 +26,7 @@ class CpService extends BaseService
                 CpClass::importPtCp($ptCp, $shop);
             }
         }
+        return $shopCp;
     }
 
 }