shish vor 4 Jahren
Ursprung
Commit
5d6f4439ea
1 geänderte Dateien mit 5 neuen und 1 gelöschten Zeilen
  1. 5 1
      app-hd/controllers/AuthController.php

+ 5 - 1
app-hd/controllers/AuthController.php

@@ -239,9 +239,13 @@ class AuthController extends PublicController
             util::fail('请先注册');
         }
         $currentShop = ShopClass::getById($currentShopId, true);
+        if (empty($currentShop)) {
+            util::fail('登录失败,没有找到门店');
+        }
         $pfShopId = $currentShop->pfShopId ?? 0;
         $adminId = $admin['id'];
-        $shopAdmin = ShopAdminService::getByCondition(['adminId' => $adminId, 'shopId' => $currentShopId, 'delStatus' => 0], true);
+        $mainId = $currentShop->mainId ?? 0;
+        $shopAdmin = ShopAdminService::getByCondition(['mainId' => $mainId, 'adminId' => $adminId], true);
         if (empty($shopAdmin)) {
             util::fail('没有权限操作');
         }