Procházet zdrojové kódy

添加修改分类 添加花材 加盟店会同步

shish před 3 roky
rodič
revize
fedf58d340

+ 1 - 5
app-ghs/controllers/ItemClassController.php

@@ -85,17 +85,13 @@ class ItemClassController extends BaseController
         $class->inTurn = $inTurn;
         $class->save();
 
-        //在首店修改,则父级下所有直店,同步修改
+        //在首店修改,则父级下所有直管和加盟店,同步修改
         $masterShop = $this->shop;
         if (isset($masterShop->default) && $masterShop->default == 1) {
             $sjId = $masterShop->sjId ?? 0;
             $shopList = ShopClass::getAllByCondition(['sjId' => $sjId], null, '*', null, true);
             foreach ($shopList as $shop) {
                 $shopId = $shop->id ?? 0;
-                if (isset($shop->join) && $shop->join == 1) {
-                    //加盟店不同步修改
-                    continue;
-                }
                 if ($shopId == $masterShop->id) {
                     //前面已经修改过了
                     continue;

+ 1 - 4
biz-ghs/item/classes/ItemClassClass.php

@@ -45,15 +45,12 @@ class ItemClassClass extends BaseClass
             util::fail("花材分类名称已存在");
         }
         $res = self::add($data);
-        //在首店添加,则父级下所有直店,同步添加分类
+        //在首店添加,则父级下所有直管和加盟店,同步添加分类
         if (isset($masterShop->default) && $masterShop->default == 1) {
             $sjId = $masterShop->sjId ?? 0;
             $shopList = ShopClass::getAllByCondition(['sjId' => $sjId], null, '*', null, true);
             foreach ($shopList as $shop) {
                 $shopId = $shop->id ?? 0;
-                if (isset($shop->join) && $shop->join == 1) {
-                    continue;
-                }
                 if ($shopId == $masterShop->id) {
                     //前面已经添加过了
                     continue;

+ 2 - 5
biz-ghs/product/classes/ProductClass.php

@@ -893,7 +893,7 @@ class ProductClass extends BaseClass
         unset($upData['status']);
 
         if (isset($shop->default) && $shop->default == 1) {
-            //首店修改同步到所有直营店
+            //首店修改同步到所有直营店,暂不同时修改加盟店
             $chainShopList = ShopClass::getAllByCondition(['sjId' => $sjId], null, '*', null, true);
             foreach ($chainShopList as $chainShop) {
                 $chainShopId = $chainShop->id ?? 0;
@@ -1245,14 +1245,11 @@ class ProductClass extends BaseClass
                 StockRecordClass::addCheckOrderRecord($record);
             }
 
-            //在首店添加,则找到父级sj下的所有直营店,同步添加花材
+            //在首店添加,则找到父级sj下的所有直营和加盟店,都进行同步
             if (isset($currentShop->default) && $currentShop->default == 1) {
                 $shopList = ShopClass::getAllByCondition(['sjId' => $data['sjId']], null, '*', null, true);
                 foreach ($shopList as $shop) {
                     $shopId = $shop->id ?? 0;
-                    if (isset($shop->join) && $shop->join == 1) {
-                        continue;
-                    }
                     if ($shopId == $currentShop->id) {
                         //前面已经添加过了
                         continue;