|
|
@@ -155,16 +155,23 @@ class ShopController extends BaseController
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //显示和隐藏库存,同时影响到老客户和新注册客户 ssh 20250309
|
|
|
+ //显示和隐藏库存,同时影响到老客户和新注册客户 ssh 20250309 暂时由石少华改,可以影响到所有人
|
|
|
$showStock = $post['showStock'] ?? 0;
|
|
|
$shopId = $this->shopId;
|
|
|
- $customList = CustomClass::getAllByCondition(['ownShopId' => $shopId], null, 'id,ghsId,ownShopId', null, true);
|
|
|
- if (!empty($customList)) {
|
|
|
- foreach ($customList as $key => $custom) {
|
|
|
- $ghsId = $custom->ghsId ?? 0;
|
|
|
- $customId = $custom->id;
|
|
|
- CustomClass::updateById($customId, ['showStock' => $showStock]);
|
|
|
- GhsClass::updateById($ghsId, ['showStock' => $showStock]);
|
|
|
+ if (getenv('YII_ENV') == 'production') {
|
|
|
+ $adminIds = [4];
|
|
|
+ } else {
|
|
|
+ $adminIds = [919];
|
|
|
+ }
|
|
|
+ if (in_array($this->adminId, $adminIds)) {
|
|
|
+ $customList = CustomClass::getAllByCondition(['ownShopId' => $shopId], null, 'id,ghsId,ownShopId', null, true);
|
|
|
+ if (!empty($customList)) {
|
|
|
+ foreach ($customList as $key => $custom) {
|
|
|
+ $ghsId = $custom->ghsId ?? 0;
|
|
|
+ $customId = $custom->id;
|
|
|
+ CustomClass::updateById($customId, ['showStock' => $showStock]);
|
|
|
+ GhsClass::updateById($ghsId, ['showStock' => $showStock]);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|