|
|
@@ -55,8 +55,7 @@ class AuthController extends PublicController
|
|
|
if (empty($phoneNumber)) {
|
|
|
util::fail('登录失败了');
|
|
|
}
|
|
|
- $ptStyle = dict::getDict('ptStyle', 'ghs');
|
|
|
- $admin = AdminClass::getByCondition(['mobile' => $phoneNumber, 'style' => $ptStyle]);
|
|
|
+ $admin = AdminClass::getByCondition(['mobile' => $phoneNumber]);
|
|
|
$currentShopId = $admin['currentGhsShopId'] ?? 0;
|
|
|
$openShop = $admin['openGhsShop'] ?? 1;
|
|
|
if (empty($currentShopId)) {
|
|
|
@@ -65,13 +64,18 @@ class AuthController extends PublicController
|
|
|
}
|
|
|
util::fail('请先注册');
|
|
|
}
|
|
|
+ $currentShop = ShopClass::getById($currentShopId, true);
|
|
|
+ if (empty($currentShop)) {
|
|
|
+ util::fail('没有找到门店');
|
|
|
+ }
|
|
|
+ $mainId = $currentShop->mainId ?? 0;
|
|
|
$adminId = $admin['id'] ?? 0;
|
|
|
//1没有开店 2已申请待审核 3已开店
|
|
|
$openShop = $admin['openGhsShop'] ?? 1;
|
|
|
if ($openShop == 2) {
|
|
|
util::fail('帐号审核中');
|
|
|
}
|
|
|
- $shopAdmin = ShopAdminClass::getByCondition(['shopId' => $currentShopId, 'adminId' => $adminId], true);
|
|
|
+ $shopAdmin = ShopAdminClass::getByCondition(['shopId' => $currentShopId, 'mainId' => $mainId], true);
|
|
|
if (empty($shopAdmin)) {
|
|
|
util::fail('请先注册');
|
|
|
}
|