shish %!s(int64=4) %!d(string=hai) anos
pai
achega
5ec54bd0fa
Modificáronse 1 ficheiros con 9 adicións e 4 borrados
  1. 9 4
      app-ghs/controllers/AuthController.php

+ 9 - 4
app-ghs/controllers/AuthController.php

@@ -63,7 +63,7 @@ class AuthController extends PublicController
             if ($openShop == 2) {
                 util::fail('审核中');
             }
-            util::fail('请先注册');
+            util::fail('请先注册..');
         }
         $currentShop = ShopClass::getById($currentShopId, true);
         if (empty($currentShop)) {
@@ -78,7 +78,7 @@ class AuthController extends PublicController
         }
         $shopAdmin = ShopAdminClass::getByCondition(['adminId' => $adminId, 'mainId' => $mainId], true);
         if (empty($shopAdmin)) {
-            util::fail('请先注册');
+            util::fail('请先注册...');
         }
         $shopAdmin->lastLogin = date("Y-m-d H:i:s");
         $shopAdmin->save();
@@ -182,7 +182,12 @@ class AuthController extends PublicController
         if ($openShop == 2) {
             util::fail('帐号审核中');
         }
-        $shopAdmin = ShopAdminClass::getByCondition(['shopId' => $currentShopId, 'adminId' => $adminId], true);
+        $currentShop = ShopClass::getById($currentShopId, true);
+        if (empty($currentShop)) {
+            util::fail('没有找到门店');
+        }
+        $mainId = $currentShop->mainId ?? 0;
+        $shopAdmin = ShopAdminClass::getByCondition(['mainId' => $mainId, 'adminId' => $adminId], true);
         if (empty($shopAdmin)) {
             util::fail('请先注册');
         }
@@ -583,7 +588,7 @@ class AuthController extends PublicController
     public function actionPrivacy()
     {
         $html = AgreementClass::xhbPrivacy(0);
-        util::success(['html'=>$html]);
+        util::success(['html' => $html]);
     }
 
 }