|
|
@@ -7,7 +7,7 @@ use bizGhs\custom\classes\CustomClass;
|
|
|
use biz\sj\classes\MerchantClass;
|
|
|
use common\components\imgUtil;
|
|
|
use common\components\noticeUtil;
|
|
|
-use common\components\sms;
|
|
|
+use biz\shop\classes\ShopClass;
|
|
|
use common\components\util;
|
|
|
use common\services\ImageService;
|
|
|
use Yii;
|
|
|
@@ -29,6 +29,27 @@ class AdminClass extends BaseClass
|
|
|
'wx84d95afcb7b594eb' => ['oTFbYvsjwgVwXggwtlM2ESAKwuN8', 'oTFbYvqP6qwdCCkdFB9GYnlzDIUg'],
|
|
|
];
|
|
|
|
|
|
+ //切换门店 lqh 2021.1.31
|
|
|
+ public static function toggleShop($admin, $newShop, $sjId, $originShopAdmin)
|
|
|
+ {
|
|
|
+ $right = \biz\shop\classes\ShopAdminClass::hasSwitchShopRight($originShopAdmin);
|
|
|
+ if (empty($right)) {
|
|
|
+ util::fail("没有权限");
|
|
|
+ }
|
|
|
+ $newShopId = $newShop->id ?? 0;
|
|
|
+ $pfShopId = $newShop->pfShopId ?? 0;
|
|
|
+ $sjShopList = ShopClass::getSjShopList($sjId);
|
|
|
+ $sjShopIds = array_column($sjShopList, 'id');
|
|
|
+ if (in_array($newShopId, $sjShopIds) == false) {
|
|
|
+ util::fail('不是您的门店');
|
|
|
+ }
|
|
|
+ $shopAdmin = \biz\shop\classes\ShopAdminClass::changeShopAddRelate($originShopAdmin, $newShop);
|
|
|
+ $admin->currentShopId = $newShopId;
|
|
|
+ $admin->currentGhsShopId = $pfShopId;
|
|
|
+ $admin->save();
|
|
|
+ return $shopAdmin;
|
|
|
+ }
|
|
|
+
|
|
|
//开店时初始化员工和角色
|
|
|
public static function initAdmin($initData, $mainId, $shop)
|
|
|
{
|