merchantId = $merchantId; $this->merchant = $merchant; $this->shopId = $shopId; $this->merchantExtend = MerchantExtendService::getByMerchantId($merchantId); $this->isWx = util::isWx(); if (empty($userId)) { $this->validate = false; } else { $this->validate = true; $this->userId = $userId; $userInfo = UserService::getUserInfo($userId); $this->user = $userInfo; } //游客可以访问的方法 if (in_array($action->id, $this->withoutLogin)) { $this->validate = true; } if ($this->validate == false) { util::notLogin(); } return parent::beforeAction($action); } }