|
|
@@ -495,7 +495,7 @@ class ProductController extends BaseController
|
|
|
$join = $shop->join ?? 0;
|
|
|
$default = $shop->default ?? 0;
|
|
|
if ($join == 0 && $default == 0) {
|
|
|
- util::fail('请在默认门店修改');
|
|
|
+ util::fail('请在总店修改');
|
|
|
}
|
|
|
|
|
|
$shopAdmin = $this->shopAdmin;
|
|
|
@@ -708,7 +708,7 @@ class ProductController extends BaseController
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //首店修改同步到所有直营店
|
|
|
+ //总店修改同步到所有门店
|
|
|
$sjId = $shop->sjId ?? 0;
|
|
|
$chainShopList = ShopClass::getAllByCondition(['sjId' => $sjId], null, '*', null, true);
|
|
|
|
|
|
@@ -770,7 +770,7 @@ class ProductController extends BaseController
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //首店修改同步到所有直营店
|
|
|
+ //总店修改同步到所有门店
|
|
|
$sjId = $shop->sjId ?? 0;
|
|
|
$chainShopList = ShopClass::getAllByCondition(['sjId' => $sjId], null, '*', null, true);
|
|
|
|
|
|
@@ -883,7 +883,7 @@ class ProductController extends BaseController
|
|
|
|
|
|
$ptItemId = $product->itemId ?? 0;
|
|
|
if (isset($shop->default) && $shop->default == 1) {
|
|
|
- //首店修改同步到所有直营店
|
|
|
+ //总店修改同步到所有门店
|
|
|
$sjId = $shop->sjId ?? 0;
|
|
|
$chainShopList = ShopClass::getAllByCondition(['sjId' => $sjId], null, '*', null, true);
|
|
|
foreach ($chainShopList as $chainShop) {
|
|
|
@@ -925,7 +925,7 @@ class ProductController extends BaseController
|
|
|
$shop = $this->shop;
|
|
|
$default = $shop->default ?? 0;
|
|
|
if ($default == 0) {
|
|
|
- util::fail('请在默认门店添加花材,分店只能修改花材');
|
|
|
+ util::fail('请在总店添加花材,分店只能修改花材');
|
|
|
}
|
|
|
$shopAdmin = $this->shopAdmin;
|
|
|
if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
|
|
|
@@ -1060,6 +1060,28 @@ class ProductController extends BaseController
|
|
|
$item->classId = $classId;
|
|
|
$item->save();
|
|
|
}
|
|
|
+ $shop = $this->shop;
|
|
|
+ if (isset($shop->default) && $shop->default == 1) {
|
|
|
+ //总店修改同步到所有门店
|
|
|
+ $sjId = $shop->sjId ?? 0;
|
|
|
+ $chainShopList = ShopClass::getAllByCondition(['sjId' => $sjId], null, '*', null, true);
|
|
|
+ foreach ($chainShopList as $chainShop) {
|
|
|
+ $chainShopId = $chainShop->id ?? 0;
|
|
|
+ if (isset($chainShop->join) && $chainShop->join == 1) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if ($chainShopId == $shop->id) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ $chainMainId = $chainShop->mainId ?? 0;
|
|
|
+ $chainProduct = ProductClass::getByCondition(['mainId' => $chainMainId, 'itemId' => $ptItemId], true);
|
|
|
+ if (!empty($chainProduct)) {
|
|
|
+ $chainProduct->delStatus = $delStatus;
|
|
|
+ $chainProduct->save();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
util::complete();
|
|
|
}
|
|
|
|