|
|
@@ -29,6 +29,14 @@ class BaseController extends PublicController
|
|
|
{
|
|
|
//定义平台类型 1花店 2供货商 3商城
|
|
|
Yii::$app->params['ptStyle'] = dict::getDict('ptStyle', 'mall');
|
|
|
+
|
|
|
+ $shopId = Yii::$app->request->get('account', 0);
|
|
|
+ $this->shopId = $shopId;
|
|
|
+ if (!empty($shopId)) {
|
|
|
+ $shop = ShopClass::getById($shopId, true);
|
|
|
+ $this->shop = $shop;
|
|
|
+ }
|
|
|
+
|
|
|
if (httpUtil::isMiniProgram()) {
|
|
|
$userId = jwt::getLoginId();
|
|
|
if (empty($userId)) {
|
|
|
@@ -42,15 +50,7 @@ class BaseController extends PublicController
|
|
|
$this->user = $user;
|
|
|
$this->isWx = util::isWx();
|
|
|
|
|
|
- //$header = httpUtil::getHeader();
|
|
|
- //$shopId = isset($header['account']) ? $header['account'] : 0;
|
|
|
- $shopId = Yii::$app->request->get('account', 0);
|
|
|
- $this->shopId = $shopId;
|
|
|
- if (!empty($shopId)) {
|
|
|
- $shop = ShopClass::getById($shopId, true);
|
|
|
- if (empty($shop)) {
|
|
|
- util::fail('没有找到门店');
|
|
|
- }
|
|
|
+ if (!empty($shop)) {
|
|
|
$sjId = $shop->sjId ?? 0;
|
|
|
if (empty($sjId)) {
|
|
|
util::fail('没有找到商家哦');
|
|
|
@@ -61,7 +61,6 @@ class BaseController extends PublicController
|
|
|
}
|
|
|
$this->sjId = $sjId;
|
|
|
$this->sj = $sj;
|
|
|
- $this->shop = $shop;
|
|
|
$this->sjExtend = MerchantExtendService::getBySjId($sjId);
|
|
|
$userInfo = isset($user->attributes) ? $user->attributes : [];
|
|
|
$custom = CustomClass::replaceCustom($sjId, $userInfo, $shopId);
|