request->getServerParam('HTTP_AUTHORIZATION'); if (!empty($authorization)) { self::getUserIdByAuthorization(); } $this->objMEnterpriseBindTemplate = new MEnterpriseBindTemplate($this->onlineUserId, $this->onlineEnterpriseId,$this->areaCode); } /** * 获取首页模版及数据 废弃 * @throws \Exception * @deprecated */ public function getTemplate() { $params = $this->request->getRawJson(); $dbResult = $this->objMEnterpriseBindTemplate->getTemplate(); if ($dbResult->isSuccess()) { $returnData = $dbResult->getData(); parent::sendOutput($returnData['data'], 0); } parent::sendOutput($dbResult->getData(), ErrorCode::$dberror); } /** * @throws \Exception */ public function homePage() { $params = $this->request->getRawJson(); $pageType = isset($params['pageType']) ? $params['pageType'] : StatusCode::$pageType['home'];//默认获取首页 $dbResult = $this->objMEnterpriseBindTemplate->homePage($pageType,$this->shopId); if ($dbResult->isSuccess()) { $returnData = $dbResult->getData(); parent::sendOutput($returnData['data'], 0); } parent::sendOutput($dbResult->getData(), ErrorCode::$dberror); } /** * Doc: (des="") * User: XMing * Date: 2020/12/28 * Time: 4:25 下午 * @throws \Exception */ public function shopHome() { $params = (array)$this->request->getRawJson(); $pageType = isset($params['pageType']) ? $params['pageType'] : StatusCode::$pageType['home'];//默认获取首页 $shopId = getArrayItem($params,'merchantId',0); $objMPage = new MPage($this->onlineUserId,$this->onlineEnterpriseId); $dbResult = $objMPage->shopHome($shopId,$pageType); if ($dbResult->isSuccess()) { $returnData = $dbResult->getData(); parent::sendOutput($returnData, 0); } parent::sendOutput($dbResult->getData(), ErrorCode::$dberror); } }