params['ptStyle'] = dict::getDict('ptStyle', 'mall'); $this->isWx = util::isWx(); $shopId = Yii::$app->request->get('account', 0); $this->shopId = $shopId; if (!empty($shopId)) { $shop = ShopClass::getById($shopId, true); if (!empty($shop)) { $mainId = $shop->mainId ?? 0; $main = MainClass::getById($mainId, true); $this->main = $main; $this->mainId = $mainId; $this->shop = $shop; $sjId = $shop->sjId ?? 0; $this->sjId = $sjId; $sj = SjClass::getById($this->sjId, true); if (empty($sj)) { util::fail('没有商家信息'); } $this->sj = $sj; $this->sjExtend = MerchantExtendService::getBySjId($this->sjId); } } $userId = jwt::getLoginId(); if (!empty($userId)) { $this->userId = $userId; $user = UserClass::getById($userId, true); if (!empty($user)) { $this->user = $user; } } return parent::beforeAction($action); } }