shish 3 anni fa
parent
commit
1adc4dfbef

+ 4 - 4
app-ghs/controllers/ProductController.php

@@ -721,7 +721,7 @@ class ProductController extends BaseController
             if (empty($ptItemId)) {
                 continue;
             }
-            if (isset($shop->default) && $shop->default == 1) {
+            if (isset($shop->default) && $shop->default == 1 && isset($shop->dataSync) && $shop->dataSync == 1) {
                 foreach ($chainShopList as $chainShop) {
                     $currentMainId = $chainShop->mainId ?? 0;
                     if ($currentMainId == $shop->mainId) {
@@ -783,7 +783,7 @@ class ProductController extends BaseController
             if (empty($ptItemId)) {
                 continue;
             }
-            if (isset($shop->default) && $shop->default == 1) {
+            if (isset($shop->default) && $shop->default == 1 && isset($shop->dataSync) && $shop->dataSync == 1) {
                 foreach ($chainShopList as $chainShop) {
                     if (isset($chainShop->join) && $chainShop->join == 1) {
                         continue;
@@ -882,7 +882,7 @@ class ProductController extends BaseController
         $product->save();
 
         $ptItemId = $product->itemId ?? 0;
-        if (isset($shop->default) && $shop->default == 1) {
+        if (isset($shop->default) && $shop->default == 1 && isset($shop->dataSync) && $shop->dataSync == 1) {
             //总店修改同步到所有门店
             $sjId = $shop->sjId ?? 0;
             $chainShopList = ShopClass::getAllByCondition(['sjId' => $sjId], null, '*', null, true);
@@ -1070,7 +1070,7 @@ class ProductController extends BaseController
                 $ptItemList[] = $ptItemId;
             }
             $shop = $this->shop;
-            if (isset($shop->default) && $shop->default == 1) {
+            if (isset($shop->default) && $shop->default == 1 && isset($shop->dataSync) && $shop->dataSync == 1) {
                 //总店修改同步到所有门店
                 $sjId = $shop->sjId ?? 0;
                 $chainShopList = ShopClass::getAllByCondition(['sjId' => $sjId], null, '*', null, true);

+ 2 - 2
biz-ghs/order/classes/PurchaseOrderClass.php

@@ -128,7 +128,7 @@ class PurchaseOrderClass extends BaseClass
                 'event' => '采购',
             ];
             CostChangeClass::addData($changeData);
-            if (isset($shop->default) && $shop->default == 1) {
+            if (isset($shop->default) && $shop->default == 1 && isset($shop->dataSync) && $shop->dataSync == 1) {
                 //直营门店的成本价也要一起改掉
                 $allShop = ShopClass::getAllByCondition(['sjId' => $sjId], null, '*', null, true);
                 if (!empty($allShop)) {
@@ -493,7 +493,7 @@ class PurchaseOrderClass extends BaseClass
                         'event' => '采购',
                     ];
                     CostChangeClass::addData($changeData);
-                    if (isset($shop->default) && $shop->default == 1) {
+                    if (isset($shop->default) && $shop->default == 1 && isset($shop->dataSync) && $shop->dataSync == 1) {
                         //直营门店的成本价也要一起改掉
                         $allShop = ShopClass::getAllByCondition(['sjId' => $sjId], null, '*', null, true);
                         if (!empty($allShop)) {

+ 1 - 1
biz-ghs/product/classes/ProductClass.php

@@ -1353,7 +1353,7 @@ class ProductClass extends BaseClass
         //不影响其它直营店花材的上下架
         unset($upData['status']);
 
-        if (isset($shop->default) && $shop->default == 1) {
+        if (isset($shop->default) && $shop->default == 1 && isset($shop->dataSync) && $shop->dataSync == 1) {
             //总店修改同步到所有门店
             $chainShopList = ShopClass::getAllByCondition(['sjId' => $sjId], null, '*', null, true);
             foreach ($chainShopList as $chainShop) {

+ 1 - 1
biz-hd/item/classes/ItemClass.php

@@ -124,7 +124,7 @@ class ItemClass extends BaseClass
         //修改其它
         self::updateById($id, $upData);
 
-        if (isset($shop->default) && $shop->default == 1) {
+        if (isset($shop->default) && $shop->default == 1 && isset($shop->dataSync) && $shop->dataSync == 1) {
             //总店修改同步到所有门店
             $chainShopList = ShopClass::getAllByCondition(['sjId' => $sjId], null, '*', null, true);
             foreach ($chainShopList as $chainShop) {