Преглед на файлове

门店shop relate 调整

shish преди 6 години
родител
ревизия
e68b617b07

+ 189 - 191
app/shop/controllers/AuthController.php

@@ -2,7 +2,7 @@
 
 namespace shop\controllers;
 
-use biz\admin\services\AdminRelateService;
+use biz\admin\services\AdminShopService;
 use biz\admin\services\AdminService;
 use biz\auth\services\AuthService;
 use biz\user\classes\UserClass;
@@ -24,194 +24,192 @@ use yii\helpers\Json;
  */
 class AuthController extends PublicController
 {
-
-    //准备授权 shish 2019.11.19
-    public function actionPrepare()
-    {
-        $get = Yii::$app->request->get();
-        $url = isset($get['url']) && !empty($get['url']) ? $get['url'] : '';
-        if (empty($url)) {
-            util::fail('没有网址');
-        }
-        $account = httpUtil::getAccount($url);
-        if (empty($account)) {
-            util::fail('没有商家帐号');
-        }
-        $merchant = MerchantService::getById($account);
-        if (empty($merchant)) {
-            util::fail('商家无效');
-        }
-        /**
-         * authScope 参数的说明
-         * 1.用户通过公众号菜单打开网页,因为已经关注过了公众号,已经生成过用户信息,所以只要使用snsapi_base静默方式拿到openid就可以
-         * 2.为了保证付款页的访问速度,暂时只要通过snsapi_base静默方式拿到openid先生成可以用的用户信息即可
-         * 3.其它情况需要获取用户完整信息的,使用snsapi_userinfo让用户授权获取信息即可
-         * 4.snsapi_base静默方式使用的场景更多,所以参数authScope默认使用snsapi_base
-         */
-        $authScope = isset($get['authScope']) ? $get['authScope'] : 'snsapi_base';
-        $urlEncode = stringUtil::urlSafeB64Encode($url);
-        //微信授权获取code shish 2019.11.24
-        wxUtil::getCode($urlEncode, $merchant, $authScope);
-        util::end();
-    }
-
-    //微信授权获取用户信息 shish 2019.11.20
-    public function actionGetUserInfo()
-    {
-        $get = Yii::$app->request->get();
-        $code = isset($get['code']) ? $get['code'] : '';
-        if (empty($code)) {
-            util::fail('没有获取用户code');
-        }
-        if (isset($get['state']) && $get['state'] == 'authdeny') {
-            util::fail('auth fail');
-        }
-        $urlEncode = $get['url'];
-        $url = stringUtil::urlSafeBase64Decode($urlEncode);
-        $account = httpUtil::getAccount($url);
-        if (empty($account)) {
-            util::stop('商店ID无效!!');
-        }
-        $merchant = xhMerchantService::getByAccount($account);
-        if (empty($merchant)) {
-            util::stop('商店无效');
-        }
-        $merchantId = $merchant['id'];
-        $authScope = isset($get['authScope']) ? $get['authScope'] : '';
-        if (empty($authScope)) {
-            util::stop('没有授权类型');
-        }
-        $data = wxUtil::getOpenId($code, $merchant);
-        if ($data === false) {
-            //微信授权获取code shish 2019.11.24
-            wxUtil::getCode($urlEncode, $merchant, $authScope);
-            util::end();
-        }
-        $openId = $data['openid'];
-        $access_token = $data['access_token'];
-        $user = UserService::getByOpenId($openId, $merchantId);
-        //用户来源
-        $userSource = Yii::$app->dict->getValue('userSourceGetId', 'official');
-        $source = $userSource['name'];
-        if (empty($user)) {
-            //$authScope 默认是 snsapi_base 公众号菜单打开网页(已经关注公众号,有完整信息)、打开付款页(有些客户只付款,没有后续可以不用登记完整信息),只需要获取openid
-            $originalInfo = [];
-            $originalInfo['openId'] = $openId;
-            $originalInfo['merchantId'] = $merchantId;
-
-            //没有关注公众号,需要获取用户完整信息的情况,则通过弹框授权
-            if ($authScope == 'snsapi_userinfo') {
-                $baseInfo = wxUtil::authGetUserInfo($openId, $access_token);
-                $originalInfo = array_merge($baseInfo, $originalInfo);
-                $originalInfo['isFull'] = 1;
-                $originalInfo['unionId'] = $baseInfo['unionid'];
-                $originalInfo['headImgUrl'] = $baseInfo['headimgurl'];
-                $originalInfo['nickName'] = $baseInfo['nickname'];
-            }
-            $user = UserService::replaceUser($originalInfo, $source, $merchantId);
-        } else {
-            if ($user['isFull'] == 0) {
-                if ($authScope == 'snsapi_userinfo') {
-                    $baseInfo = wxUtil::authGetUserInfo($openId, $access_token);
-                    $originalInfo = $baseInfo;
-                    $originalInfo['isFull'] = 1;
-                    $originalInfo['unionId'] = $baseInfo['unionid'];
-                    $originalInfo['headImgUrl'] = $baseInfo['headimgurl'];
-                    $originalInfo['openId'] = $baseInfo['openid'];
-                    $originalInfo['nickName'] = $baseInfo['nickname'];
-                    $originalInfo['merchantId'] = $merchantId;
-                    $user = UserService::replaceUser($originalInfo, $source, $merchantId);
-                }
-            }
-        }
-        //这个的基类没有设置统一的全局变量,这里进行设置一次
-        $userId = $user['id'];
-        $admin = AdminService::getByCondition(['userId' => $userId]);
-        if (empty($admin)) {
-            util::fail('您没有权限访问');
-        }
-        $adminId = $admin['id'];
-        //获取token
-        $token = jwt::getNewToken($adminId);
-        $url = strpos($url, '?') === false ? $url . '?token=' . $token : $url . '&token=' . $token;
-        $this->redirect($url);
-    }
-
-    //登陆并拿到token shish 2019.11.23
-    public function actionLogin()
-    {
-        $get = Yii::$app->request->get();
-        $mobile = isset($get['mobile']) ? $get['mobile'] : 0;
-        if (stringUtil::isMobile($mobile) == false) {
-            util::fail('请填写正常的手机号');
-        }
-        $password = isset($get['password']) && !empty($get['password']) ? $get['password'] : '';
-        if (empty($password)) {
-            util::fail('请输入密码');
-        }
-        $admin = AdminService::getByCondition(['mobile' => $mobile]);
-        if (password_verify($password, $admin['password']) == false) {
-            util::fail('密码错误');
-        }
-        $adminId = $admin['id'];
-        $relate = AdminRelateService::getByCondition(['adminId' => $adminId]);
-        $merchantId = isset($relate['merchantId']) ? $relate['merchantId'] : 0;
-        if (empty($merchantId)) {
-            util::fail('您不是管理员');
-        }
-        //管理员关联商家
-        $relateId = $relate['id'];
-        Yii::$app->redis->executeCommand('SET', ['ADMIN_RELATION_' . $adminId, $relateId]);
-        //获取token
-        $token = jwt::getNewToken($adminId);
-        util::success(['token' => $token, 'account' => $merchantId, 'merchantId' => $merchantId]);
-    }
-
-    //静默获取小程序用户信息
-    public function actionMiniInfo()
-    {
-        $code = Yii::$app->request->get('code', '');
-        if (empty($code)) {
-            util::fail('没有CODE信息');
-        }
-        $wxMiniBase = WxOpenService::getWxMiniBase();
-        $appId = $wxMiniBase['miniAppId'];
-        $appSecret = $wxMiniBase['miniAppSecret'];
-        if (empty($appSecret)) {
-            util::fail('没有找到小程序的密钥');
-        }
-        $url = "https://api.weixin.qq.com/sns/jscode2session?appid={$appId}&secret={$appSecret}&js_code={$code}&grant_type=authorization_code";
-        $curl = new curl\Curl();
-        $result = $curl->get($url);
-        $arr = Json::decode($result);
-        $sessionKey = isset($arr['session_key']) ? $arr['session_key'] : '';
-        $openid = isset($arr['openid']) ? $arr['openid'] : '';
-        $cacheKey = 'SHOP_MINI_SESSION_KEY_' . $openid;
-        Yii::$app->redis->executeCommand('SET', [$cacheKey, $sessionKey]);
-        if (empty($openid)) {
-            Yii::info(json_encode($arr));
-            util::fail('没有获取到小程序openId');
-        }
-        //用户来源
-        $userSource = UserClass::$userSourceId['mini']['name'];
-        $admin = AdminService::getByMiniOpenId($openid);
-        $relateId = 0;
-        $merchantId = 0;
-        if (empty($admin)) {
-            $adminInfo = ['miniOpenId' => $openid];
-            Yii::info(json_encode($adminInfo));
-            $admin = AdminService::replaceAdmin($adminInfo, $userSource);
-            $adminId = $admin['id'];
-        } else {
-            $adminId = $admin['id'];
-            $relate = AdminRelateService::getByCondition(['adminId' => $adminId]);
-            $relateId = isset($relate['id']) ? $relate['id'] : 0;
-            $merchantId = isset($relate['merchantId']) ? $relate['merchantId'] : 0;
-        }
-        //管理员关联商家
-        Yii::$app->redis->executeCommand('SET', ['ADMIN_RELATION_' . $adminId, $relateId]);
-        $token = jwt::getNewToken($adminId);
-        util::success(['token' => $token, 'admin' => $admin, 'merchantId' => 0]);
-    }
-
+	
+	//准备授权 shish 2019.11.19
+	public function actionPrepare()
+	{
+		$get = Yii::$app->request->get();
+		$url = isset($get['url']) && !empty($get['url']) ? $get['url'] : '';
+		if (empty($url)) {
+			util::fail('没有网址');
+		}
+		$account = httpUtil::getAccount($url);
+		if (empty($account)) {
+			util::fail('没有商家帐号');
+		}
+		$merchant = MerchantService::getById($account);
+		if (empty($merchant)) {
+			util::fail('商家无效');
+		}
+		/**
+		 * authScope 参数的说明
+		 * 1.用户通过公众号菜单打开网页,因为已经关注过了公众号,已经生成过用户信息,所以只要使用snsapi_base静默方式拿到openid就可以
+		 * 2.为了保证付款页的访问速度,暂时只要通过snsapi_base静默方式拿到openid先生成可以用的用户信息即可
+		 * 3.其它情况需要获取用户完整信息的,使用snsapi_userinfo让用户授权获取信息即可
+		 * 4.snsapi_base静默方式使用的场景更多,所以参数authScope默认使用snsapi_base
+		 */
+		$authScope = isset($get['authScope']) ? $get['authScope'] : 'snsapi_base';
+		$urlEncode = stringUtil::urlSafeB64Encode($url);
+		//微信授权获取code shish 2019.11.24
+		wxUtil::getCode($urlEncode, $merchant, $authScope);
+		util::end();
+	}
+	
+	//微信授权获取用户信息 shish 2019.11.20
+	public function actionGetUserInfo()
+	{
+		$get = Yii::$app->request->get();
+		$code = isset($get['code']) ? $get['code'] : '';
+		if (empty($code)) {
+			util::fail('没有获取用户code');
+		}
+		if (isset($get['state']) && $get['state'] == 'authdeny') {
+			util::fail('auth fail');
+		}
+		$urlEncode = $get['url'];
+		$url = stringUtil::urlSafeBase64Decode($urlEncode);
+		$account = httpUtil::getAccount($url);
+		if (empty($account)) {
+			util::stop('商店ID无效!!');
+		}
+		$merchant = xhMerchantService::getByAccount($account);
+		if (empty($merchant)) {
+			util::stop('商店无效');
+		}
+		$merchantId = $merchant['id'];
+		$authScope = isset($get['authScope']) ? $get['authScope'] : '';
+		if (empty($authScope)) {
+			util::stop('没有授权类型');
+		}
+		$data = wxUtil::getOpenId($code, $merchant);
+		if ($data === false) {
+			//微信授权获取code shish 2019.11.24
+			wxUtil::getCode($urlEncode, $merchant, $authScope);
+			util::end();
+		}
+		$openId = $data['openid'];
+		$access_token = $data['access_token'];
+		$user = UserService::getByOpenId($openId, $merchantId);
+		//用户来源
+		$userSource = Yii::$app->dict->getValue('userSourceGetId', 'official');
+		$source = $userSource['name'];
+		if (empty($user)) {
+			//$authScope 默认是 snsapi_base 公众号菜单打开网页(已经关注公众号,有完整信息)、打开付款页(有些客户只付款,没有后续可以不用登记完整信息),只需要获取openid
+			$originalInfo = [];
+			$originalInfo['openId'] = $openId;
+			$originalInfo['merchantId'] = $merchantId;
+			
+			//没有关注公众号,需要获取用户完整信息的情况,则通过弹框授权
+			if ($authScope == 'snsapi_userinfo') {
+				$baseInfo = wxUtil::authGetUserInfo($openId, $access_token);
+				$originalInfo = array_merge($baseInfo, $originalInfo);
+				$originalInfo['isFull'] = 1;
+				$originalInfo['unionId'] = $baseInfo['unionid'];
+				$originalInfo['headImgUrl'] = $baseInfo['headimgurl'];
+				$originalInfo['nickName'] = $baseInfo['nickname'];
+			}
+			$user = UserService::replaceUser($originalInfo, $source, $merchantId);
+		} else {
+			if ($user['isFull'] == 0) {
+				if ($authScope == 'snsapi_userinfo') {
+					$baseInfo = wxUtil::authGetUserInfo($openId, $access_token);
+					$originalInfo = $baseInfo;
+					$originalInfo['isFull'] = 1;
+					$originalInfo['unionId'] = $baseInfo['unionid'];
+					$originalInfo['headImgUrl'] = $baseInfo['headimgurl'];
+					$originalInfo['openId'] = $baseInfo['openid'];
+					$originalInfo['nickName'] = $baseInfo['nickname'];
+					$originalInfo['merchantId'] = $merchantId;
+					$user = UserService::replaceUser($originalInfo, $source, $merchantId);
+				}
+			}
+		}
+		//这个的基类没有设置统一的全局变量,这里进行设置一次
+		$userId = $user['id'];
+		$admin = AdminService::getByCondition(['userId' => $userId]);
+		if (empty($admin)) {
+			util::fail('您没有权限访问');
+		}
+		$adminId = $admin['id'];
+		//获取token
+		$token = jwt::getNewToken($adminId);
+		$url = strpos($url, '?') === false ? $url . '?token=' . $token : $url . '&token=' . $token;
+		$this->redirect($url);
+	}
+	
+	//登陆并拿到token shish 2019.11.23
+	public function actionLogin()
+	{
+		$get = Yii::$app->request->get();
+		$mobile = isset($get['mobile']) ? $get['mobile'] : 0;
+		if (stringUtil::isMobile($mobile) == false) {
+			util::fail('请填写正常的手机号');
+		}
+		$password = isset($get['password']) && !empty($get['password']) ? $get['password'] : '';
+		if (empty($password)) {
+			util::fail('请输入密码');
+		}
+		$admin = AdminService::getByCondition(['mobile' => $mobile]);
+		if (password_verify($password, $admin['password']) == false) {
+			util::fail('密码错误');
+		}
+		$adminId = $admin['id'];
+		$adminShop = AdminShopService::getByCondition(['adminId' => $adminId]);
+		$merchantId = isset($adminShop['merchantId']) ? $adminShop['merchantId'] : 0;
+		$shopId = isset($adminShop['shopId']) ? $adminShop['shopId'] : 0;
+		if (empty($merchantId)) {
+			util::fail('您不是管理员');
+		}
+		//管理员关联门店
+		Yii::$app->redis->executeCommand('SET', ['ADMIN_SHOP_' . $adminId, $shopId]);
+		//获取token
+		$token = jwt::getNewToken($adminId);
+		util::success(['token' => $token, 'account' => $merchantId, 'merchantId' => $merchantId]);
+	}
+	
+	//静默获取小程序用户信息
+	public function actionMiniInfo()
+	{
+		$code = Yii::$app->request->get('code', '');
+		if (empty($code)) {
+			util::fail('没有CODE信息');
+		}
+		$wxMiniBase = WxOpenService::getWxMiniBase();
+		$appId = $wxMiniBase['miniAppId'];
+		$appSecret = $wxMiniBase['miniAppSecret'];
+		if (empty($appSecret)) {
+			util::fail('没有找到小程序的密钥');
+		}
+		$url = "https://api.weixin.qq.com/sns/jscode2session?appid={$appId}&secret={$appSecret}&js_code={$code}&grant_type=authorization_code";
+		$curl = new curl\Curl();
+		$result = $curl->get($url);
+		$arr = Json::decode($result);
+		$sessionKey = isset($arr['session_key']) ? $arr['session_key'] : '';
+		$openid = isset($arr['openid']) ? $arr['openid'] : '';
+		$cacheKey = 'SHOP_MINI_SESSION_KEY_' . $openid;
+		Yii::$app->redis->executeCommand('SET', [$cacheKey, $sessionKey]);
+		if (empty($openid)) {
+			Yii::info(json_encode($arr));
+			util::fail('没有获取到小程序openId');
+		}
+		//用户来源
+		$userSource = UserClass::$userSourceId['mini']['name'];
+		$admin = AdminService::getByMiniOpenId($openid);
+		$shopId = 0;
+		if (empty($admin)) {
+			$adminInfo = ['miniOpenId' => $openid];
+			Yii::info(json_encode($adminInfo));
+			$admin = AdminService::replaceAdmin($adminInfo, $userSource);
+			$adminId = $admin['id'];
+		} else {
+			$adminId = $admin['id'];
+			$relate = AdminShopService::getByCondition(['adminId' => $adminId]);
+			$shopId = isset($relate['shopId']) ? $relate['shopId'] : 0;
+		}
+		//管理员关联商家
+		Yii::$app->redis->executeCommand('SET', ['ADMIN_SHOP_' . $adminId, $shopId]);
+		$token = jwt::getNewToken($adminId);
+		util::success(['token' => $token, 'admin' => $admin, 'shopId' => $shopId]);
+	}
+	
 }

+ 58 - 54
app/shop/controllers/BaseController.php

@@ -2,68 +2,72 @@
 
 namespace shop\controllers;
 
-use biz\admin\services\AdminRelateService;
+use biz\admin\services\AdminShopService;
 use biz\merchant\services\AdminService;
 use biz\merchant\services\MerchantExtendService;
 use biz\merchant\services\MerchantService;
+use biz\merchant\services\ShopService;
 use common\components\jwt;
 use Yii;
 use common\components\util;
 
 class BaseController extends PublicController
 {
-    public $admin, $adminId, $adminAvatar, $account;
-    public $merchantId = 0, $merchantName, $merchant, $merchantExtend, $merchantLogo, $signPackage;
-    public $openMerchant, $openMerchantId;
-    public $appId;
-    public $isWx = false;
-    public $isLogin = false;
-    public $withoutLogin = [];//不需要登陆的方法名
-    public $validate = true;
-
-    //shish 2020.3.8
-    public function beforeAction($action)
-    {
-        //token验证
-        $adminId = jwt::getLoginId();
-        $merchantId = 0;
-        $merchant = [];
-        $merchantExtend = [];
-        $admin = [];
-        if (empty($adminId)) {
-            $this->validate = false;
-        } else {
-            $admin = AdminService::getById($adminId);
-            if (empty($admin)) {
-                util::fail('帐号无效');
-            }
-            $adminId = $admin['id'];
-            $relateId = Yii::$app->redis->executeCommand('GET', ['ADMIN_RELATION_' . $adminId]);
-            //缓存取得的不是数字可能被清缓存,需要重新登陆,$relateId = 0 则表示没有关联的商家
-            if (is_numeric($relateId) == false) {
-                util::notLogin('请重新进行登陆');
-            }
-            if (!empty($relateId)) {
-                $relate = AdminRelateService::getById($relateId);
-                $merchantId = $relate['merchantId'];
-                $merchant = MerchantService::getMerchantById($merchantId);
-                $merchantExtend = MerchantExtendService::getByMerchantId($merchantId);
-            }
-        }
-        //游客可以访问的方法
-        if (in_array($action->id, $this->withoutLogin)) {
-            $this->validate = true;
-        }
-        if ($this->validate == false) {
-            util::notLogin('您还没有登陆哦');
-        }
-        $this->admin = $admin;
-        $this->adminId = $adminId;
-        $this->merchantId = $merchantId;
-        $this->merchant = $merchant;
-        $this->merchantExtend = $merchantExtend;
-        return parent::beforeAction($action);
-    }
-
+	public $admin, $adminId, $adminAvatar, $account;
+	public $merchantId = 0, $merchantName, $merchant, $merchantExtend, $merchantLogo, $signPackage;
+	public $openMerchant, $openMerchantId;
+	public $appId;
+	public $isWx = false;
+	public $isLogin = false;
+	public $withoutLogin = [];//不需要登陆的方法名
+	public $validate = true;
+	
+	//shish 2020.3.8
+	public function beforeAction($action)
+	{
+		//token验证
+		$adminId = jwt::getLoginId();
+		$merchantId = 0;
+		$merchant = [];
+		$merchantExtend = [];
+		$admin = [];
+		if (empty($adminId)) {
+			$this->validate = false;
+		} else {
+			$admin = AdminService::getById($adminId);
+			if (empty($admin)) {
+				util::fail('帐号无效');
+			}
+			$adminId = $admin['id'];
+			$shopId = Yii::$app->redis->executeCommand('GET', ['ADMIN_SHOP_' . $adminId]);
+			//取不到门店id可能被清缓存,需要重新登陆,$shopId = 0 则表示非管理员,没有关联的门店,只可以访问官网
+			if (is_numeric($shopId) == false) {
+				util::notLogin('请重新进行登陆');
+			}
+			if (!empty($shopId)) {
+				$shop = ShopService::getById($shopId);
+				if (empty($shop)) {
+					util::fail('您所管理的门店已经失踪了');
+				}
+				$merchantId = $shop['merchantId'];
+				$merchant = MerchantService::getMerchantById($merchantId);
+				$merchantExtend = MerchantExtendService::getByMerchantId($merchantId);
+			}
+		}
+		//游客可以访问的方法
+		if (in_array($action->id, $this->withoutLogin)) {
+			$this->validate = true;
+		}
+		if ($this->validate == false) {
+			util::notLogin('您还没有登陆哦');
+		}
+		$this->admin = $admin;
+		$this->adminId = $adminId;
+		$this->merchantId = $merchantId;
+		$this->merchant = $merchant;
+		$this->merchantExtend = $merchantExtend;
+		return parent::beforeAction($action);
+	}
+	
 }
 

+ 3 - 3
biz/admin/classes/AdminClass.php

@@ -82,7 +82,7 @@ class AdminClass extends BaseClass
         $user = UserClass::getById($userId);
         UserClass::valid($user, $merchantId);
 
-        $relateUserIdList = self::getAdminRelateUserId($merchantId);
+        $relateUserIdList = self::getAdminShopUserId($merchantId);
         if (in_array($userId, $relateUserIdList)) {
             util::fail('您选择的微信已经绑定别的帐号');
         }
@@ -113,7 +113,7 @@ class AdminClass extends BaseClass
     }
 
     //获取商家所有员工已经关联微信的userId
-    public static function getAdminRelateUserId($merchantId)
+    public static function getAdminShopUserId($merchantId)
     {
         $list = self::getAdminList($merchantId);
         return !empty($list) ? array_column($list, 'userId') : [];
@@ -161,7 +161,7 @@ class AdminClass extends BaseClass
             $user = UserClass::getById($userId);
             UserClass::valid($user, $merchantId);
 
-            $relateUserIdList = self::getAdminRelateUserId($merchantId);
+            $relateUserIdList = self::getAdminShopUserId($merchantId);
             if (in_array($userId, $relateUserIdList)) {
                 util::fail('您选择的微信已经绑定别的帐号');
             }

+ 2 - 2
biz/admin/classes/AdminRelateClass.php → biz/admin/classes/AdminShopClass.php

@@ -7,9 +7,9 @@ use common\components\util;
 use Yii;
 use biz\base\classes\BaseClass;
 
-class AdminRelateClass extends BaseClass
+class AdminShopClass extends BaseClass
 {
 
-	public static $baseFile = '\biz\admin\models\AdminRelate';
+	public static $baseFile = '\biz\admin\models\AdminShop';
 
 }

+ 2 - 2
biz/admin/models/AdminRelate.php → biz/admin/models/AdminShop.php

@@ -4,12 +4,12 @@ namespace biz\admin\models;
 
 use biz\base\models\Base;
 
-class AdminRelate extends Base
+class AdminShop extends Base
 {
 	
 	public static function tableName()
 	{
-		return 'xhAdminRelate';
+		return 'xhAdminShop';
 	}
 	
 }

+ 2 - 2
biz/admin/services/AdminRelateService.php → biz/admin/services/AdminShopService.php

@@ -13,9 +13,9 @@ use common\components\util;
 use common\services\xhTMessageService;
 use Yii;
 
-class AdminRelateService extends BaseService
+class AdminShopService extends BaseService
 {
 	
-	public static $baseFile = '\biz\admin\classes\AdminRelateClass';
+	public static $baseFile = '\biz\admin\classes\AdminShopClass';
 	
 }

+ 3 - 0
console/controllers/UpgradeController.php

@@ -1376,6 +1376,9 @@ ALTER TABLE `xhAdmin` DROP COLUMN `currentShopId`;";
         $sql = "ALTER TABLE `xhWxOpen` ADD `openAppBind` TINYINT NOT NULL DEFAULT 0 COMMENT '绑定平台状况 0没有创建 1公众号已绑 2小程序已绑 3公众号和小程序都已绑' AFTER `appIdCreated`;";
         Yii::$app->db->createCommand($sql)->execute($sql);
 
+        $sql = "RENAME TABLE xhAdminRelate TO xhAdminShop;";
+	    Yii::$app->db->createCommand($sql)->execute($sql);
+
     }
 
     //数据迁移 shish 2020.1.12