|
|
@@ -2,6 +2,7 @@
|
|
|
|
|
|
namespace ghs\controllers;
|
|
|
|
|
|
+use biz\shop\classes\ShopAdminClass;
|
|
|
use biz\sj\services\MerchantExtendService;
|
|
|
use bizGhs\admin\classes\AdminClass;
|
|
|
use bizGhs\merchant\classes\ShopClass;
|
|
|
@@ -223,4 +224,33 @@ class ShopController extends BaseController
|
|
|
util::success(['info' => $shop]);
|
|
|
}
|
|
|
|
|
|
+ //获取平台所有的供应商门店 shish 20210908
|
|
|
+ public function actionGetPtGhsShop()
|
|
|
+ {
|
|
|
+ $shop = ShopClass::getAllByCondition(['ptStyle' => 2], 'id asc', '*');
|
|
|
+ util::success(['list' => $shop]);
|
|
|
+ }
|
|
|
+
|
|
|
+ //切换门店 shish 20210908
|
|
|
+ public function actionSwitchGhsShop()
|
|
|
+ {
|
|
|
+ $shopAdmin = $this->shopAdmin;
|
|
|
+ $adminId = $shopAdmin->adminId ?? 0;
|
|
|
+ if ($adminId != 2) {
|
|
|
+ util::fail('没有权限');
|
|
|
+ }
|
|
|
+ $shopId = Yii::$app->request->get('shopId', 0);
|
|
|
+ $admin = \biz\admin\classes\AdminClass::getById($adminId, true);
|
|
|
+ if (empty($admin)) {
|
|
|
+ util::fail('没有找到这个管理员');
|
|
|
+ }
|
|
|
+ $shopAdmin = ShopAdminClass::getByCondition(['shopId' => $shopId, 'adminId' => $adminId], true);
|
|
|
+ if (empty($shopAdmin)) {
|
|
|
+ util::fail('您不是这个店里的员工');
|
|
|
+ }
|
|
|
+ $admin->currentShopId = $shopId;
|
|
|
+ $admin->save();
|
|
|
+ util::complete();
|
|
|
+ }
|
|
|
+
|
|
|
}
|