|
|
@@ -343,27 +343,24 @@ class ShopController extends BaseController
|
|
|
//切换门店 ssh 20220624
|
|
|
public function actionSwitchGhsShop()
|
|
|
{
|
|
|
- $shopAdmin = $this->shopAdmin;
|
|
|
- $adminId = $shopAdmin->adminId ?? 0;
|
|
|
- $admin = $this->admin;
|
|
|
$shopId = Yii::$app->request->get('shopId', 0);
|
|
|
$shop = ShopClass::getById($shopId, true);
|
|
|
if (empty($shop)) {
|
|
|
util::fail('没有找到门店');
|
|
|
}
|
|
|
- $mainId = $shop->mainId ?? 0;
|
|
|
- $staff = ShopAdminClass::getByCondition(['mainId' => $mainId, 'adminId' => $adminId], true);
|
|
|
- if (empty($staff)) {
|
|
|
- util::fail('没有权限哦...');
|
|
|
- }
|
|
|
- $delStatus = $staff->delStatus ?? 0;
|
|
|
- if ($delStatus == 1) {
|
|
|
- util::fail('你不是员工');
|
|
|
- }
|
|
|
- $status = $staff->status ?? 0;
|
|
|
- if ($status == 0) {
|
|
|
- util::fail('无法登录,请联系店长');
|
|
|
+ $shopAdmin = $this->shopAdmin;
|
|
|
+ $admin = $this->admin;
|
|
|
+ $adminId = $this->adminId ?? 0;
|
|
|
+ if (getenv('YII_ENV') == 'production') {
|
|
|
+ if (in_array($adminId, [4]) == false) {
|
|
|
+ util::fail('没有权限切换,请联系管理员');
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (in_array($adminId, [919]) == false) {
|
|
|
+ util::fail('没有权限切换,请联系管理员');
|
|
|
+ }
|
|
|
}
|
|
|
+ ShopAdminClass::changeShopAddRelate($shopAdmin, $shop, 1);
|
|
|
$admin->currentGhsShopId = $shopId;
|
|
|
$lsShopId = $shop->lsShopId ?? 0;
|
|
|
$admin->currentShopId = $lsShopId;
|