enterpriseId = $enterpriseId; $this->userCenterId = $userCenterId; parent::__construct($this->enterpriseId, $this->userCenterId); $this->objDOem = new DOem('default'); $this->objDEnterprise = new DEnterprise('default'); } /** * 获取指定logo贴牌 */ public function getOemInfo($oemId) { $dbResult = $this->objDOem->get($oemId); if($dbResult === false){ return ResultWrapper::fail($this->objDOem->error(), ErrorCode::$dberror); } else { return ResultWrapper::success( $dbResult ); } } /** * 通过域名获取指定ome数据 */ public function getOemInfoByDomain($domain) { $dbResult = $this->objDOem->get(['domain'=>$domain]); if($dbResult === false){ return ResultWrapper::fail($this->objDOem->error(), ErrorCode::$dberror); } else { return ResultWrapper::success( $dbResult ); } } /** * 通过api域名获取指定ome数据 */ public function getOemInfoByApiDomain($apiDomain) { $dbResult = $this->objDOem->get(['apiDomain'=>$apiDomain]); if($dbResult === false){ return ResultWrapper::fail($this->objDOem->error(), ErrorCode::$dberror); } else { return ResultWrapper::success( $dbResult ); } } /** * 通过微信开发平台appid获取指定oem数据 */ public function getOemInfoByWeiXinOpenAppId($appid) { $dbResult = $this->objDOem->get(['weixinOpenAppid'=>$appid]); if($dbResult === false){ return ResultWrapper::fail($this->objDOem->error(), ErrorCode::$dberror); } else { return ResultWrapper::success( $dbResult ); } } /** * 通过企业id获取指定ome数据 */ public function getOemInfoByenterpriseId($enterpriseId) { $this->objDEnterprise->setTable('qianniao_enterprise_1'); $enterpriseIdDbResult = $this->objDEnterprise->get(['id'=>$enterpriseId]); if($enterpriseIdDbResult === false){ return ResultWrapper::fail($this->objDEnterprise->error(), ErrorCode::$dberror); } if(empty($enterpriseIdDbResult)){ return ResultWrapper::fail('查询数据为空', ErrorCode::$dberror); } if($enterpriseIdDbResult['isoem'] == StatusCode::$delete){ $dbResult = $this->objDOem->get(['enterpriseId'=> 4]); }else{ $dbResult = $this->objDOem->get(['enterpriseId'=>$enterpriseIdDbResult['oemId']]); } if($dbResult === false){ return ResultWrapper::fail($this->objDOem->error(), ErrorCode::$dberror); } if(empty($dbResult)){ return ResultWrapper::fail('oem配置项为空', ErrorCode::$dberror); } return ResultWrapper::success( $dbResult ); } }