sjId = $sjId; $this->sj = $sj; $this->shopId = $shopId; $this->sjExtend = MerchantExtendService::getByMerchantId($sjId); $this->isWx = util::isWx(); if (empty($userId)) { $this->validate = false; } else { $this->validate = true; $this->userId = $userId; $userInfo = UserService::getUserInfo($userId); if (empty($userInfo)) { util::fail('没有用户信息'); } $this->user = $userInfo; $customId = CustomClass::getCurrentCustomId($sjId, $userInfo); $this->customId = $customId; } //游客可以访问的方法 if (in_array($action->id, $this->guestAccessAction)) { $this->validate = true; } if ($this->validate == false) { util::notLogin(); } return parent::beforeAction($action); } }