private function moveAjkPPCFixPlanRelation($cityId, $brokerId, $fixPlan) { $planId = $fixPlan['id']; $fixPlanHouseRelationList = BLL_Plan_EsfPropFixedPlanRelation::getPropFixedPlanRelation($brokerId, $cityId, $planId); if (empty($fixPlanHouseRelationList)) { $this->logMsg(sprintf('二手房计划[%d - %d - %d]没有获取到房源定价计划关系', $cityId, $brokerId, $planId)); return; } foreach ($fixPlanHouseRelationList as $fixPlanHouseRelation) { $comboHouseRelation = Bll_Combo_HouseRelation::getRelationByHouseId($fixPlanHouseRelation['propId'], Model_Combo_HouseRelation::SITE_TYPE_AJK); if (!empty($comboHouseRelation)) { if ($comboHouseRelation['state'] == Model_Combo_HouseRelation::ENUM_COMBO_EXPIRE) { $this->logMsg(sprintf('房源[%d]的套餐关系存在id[%d],且state==205', $fixPlanHouseRelation['propId'], $comboHouseRelation['id'])); continue; } if (1 == Bll_Combo_HouseRelation::updateComboStatusById($comboHouseRelation['id'], Model_Combo_HouseRelation::ENUM_COMBO_EXPIRE, Model_Combo_HouseRelation::SITE_TYPE_AJK)) { $this->logMsg(sprintf('房源[%d]的套餐关系存在id[%d],更新成功', $fixPlanHouseRelation['propId'], $comboHouseRelation['id'])); } else { $this->logMsg(sprintf('房源[%d]的套餐关系存在id[%d],更新失败', $fixPlanHouseRelation['propId'], $comboHouseRelation['id'])); } continue; } $data = array('houseId' => $fixPlanHouseRelation['propId'], 'brokerId' => $brokerId, 'cityId' => $cityId, 'state' => Model_Combo_HouseRelation::ENUM_COMBO_EXPIRE, 'created' => $fixPlanHouseRelation['updatedDatetime']); if (1 == Model_Combo_HouseRelation::create($data, Model_Combo_HouseRelation::SITE_TYPE_AJK)->save()) { $this->logMsg(sprintf('房源[%d]转移成功', $fixPlanHouseRelation['propId'])); } else { $this->logMsg(sprintf('房源[%d]转移失败', $fixPlanHouseRelation['propId'])); } } }
public static function &get_instance() { if (self::$_instance === null) { self::$_instance = new BLL_Plan_EsfPropFixedPlanRelation(); } return self::$_instance; }
/** * 获取二手房房源数据 * [getBrokerEsfPro description] */ private function getBrokerEsfPro() { //判断是否是套餐城市 $data = $proClickInfo = array(); $isCombo = Bll_Combo_HouseRelation::isComboCity($this->cityId); if ($isCombo['data']) { //套餐城市 $comboList = Bll_Combo_HouseRelation::getHouseRelations($this->brokerId, Bll_Combo_HouseRelation::SITE_TYPE_AJK, 1); $proIds = $this->getObjFieldInfo($comboList, 'houseId'); $clicksInfo = Bll_Ppc_NewPackageStatsBrokerDay::getHouseComboClickInfo($proIds, date('Ymd'), Model_Ppc_NewPackageStatsHouseDay::SITE_TYPE_AJK); if (!empty($clicksInfo)) { foreach ($clicksInfo as $val) { if (isset($proClickInfo[$val['propId']])) { $proClickInfo[$val['propId']] += intval($val['cnum']); } else { $proClickInfo[$val['propId']] = intval($val['cnum']); } } } } else { //经纪人计划信息 $brokerPlanInfo = BLL_Plan_EsfPropFixedPlanRelation::get_instance()->getBrokerEsfOnlinePlan($this->brokerId); if (empty($brokerPlanInfo)) { //计划数据为空 $this->outData($data, 1); } //计划IDs $planIds = $this->getObjFieldInfo($brokerPlanInfo, 'id'); //定价推广房源 $fixedProInfos = Bll_Fixedspread_AjkFixedSpread::getFixedOnlineProByPlanIds($this->cityId, $planIds); if (empty($fixedProInfos)) { $this->outData($data, 1); } //房源IDs $proIds = $this->getObjFieldInfo($fixedProInfos, 'proId'); //房源点击量 $proClickDao = new DAO_My_Ppc_PlanOpe(); $proClickInfo = $proClickDao->getProClick($proIds); } $proInfos = Bll_House_EsfHouse::getHouseInfo($proIds, $this->cityId); if (empty($proInfos)) { $this->outData($data, 1); } //经纪人橱窗房源设置信息 $adProInfos = Bll_Broker_ShowcaseAdSetPro::getInstance()->getBrokerAdSalePropInfo($this->brokerId); $addPro = array(); if (!empty($adProInfos)) { foreach ($adProInfos as $adProVal) { $addPro[$adProVal->propId] = true; } } $this->initEsfProData($proInfos, $proClickInfo, $addPro); }
/** * 判断给定房源是否在线上推广 * @param $brokerId 二手房经纪人ID * @param $cityId 城市ID * @param $type 类型,二手房或者租房或者商业地产 * @param $filterProIds * @param array $updateTimeArr * @param array $newFixedProInfos * @return array */ public function filterProIds($brokerId, $cityId, $type, $filterProIds, &$updateTimeArr = array(), &$newFixedProInfos = array()) { //判断是否是套餐城市 $isCombo = Bll_Combo_HouseRelation::isComboCity($cityId); if ($type == Const_ShowcaseOrders::SALE_DB) { //二手房 //经纪人计划信息 if ($isCombo['data']) { //套餐城市 $comboList = Bll_Combo_HouseRelation::getHouseRelations($brokerId, Bll_Combo_HouseRelation::SITE_TYPE_AJK, 1); foreach ($comboList as $comboVal) { $uTime = strtotime($comboVal['updateTime']); $newFixedProInfos[$comboVal['houseId']] = array($comboVal['houseId'], $uTime); $updateTimeArr[$comboVal['houseId']] = $uTime; } } else { //PPC城市 $brokerPlanInfo = BLL_Plan_EsfPropFixedPlanRelation::get_instance()->getBrokerEsfOnlinePlan($brokerId); if (empty($brokerPlanInfo)) { return array(); } //计划ID $planIds = array(); foreach ($brokerPlanInfo as $brokerPlanVal) { $planIds[] = $brokerPlanVal->id; } //定价推广房源 $fixedProInfos = Bll_Fixedspread_AjkFixedSpread::getFixedOnlineProByPlanIds($cityId, $planIds); if (empty($fixedProInfos)) { return array(); } foreach ($fixedProInfos as $fixedProVal) { $uTime = strtotime($fixedProVal->updatedDateTime); $newFixedProInfos[$fixedProVal->proId] = array($fixedProVal->proId, $uTime); $updateTimeArr[$fixedProVal->proId] = $uTime; } } } elseif ($type == Const_ShowcaseOrders::RENT_DB) { //如果是租房 if ($isCombo['data']) { //套餐城市 $comboList = Bll_Combo_HouseRelation::getHouseRelations($brokerId, Bll_Combo_HouseRelation::SITE_TYPE_HZ, 1); foreach ($comboList as $comboVal) { $uTime = strtotime($comboVal['updateTime']); $newFixedProInfos[$comboVal['houseId']] = array($comboVal['houseId'], $uTime); $updateTimeArr[$comboVal['houseId']] = $uTime; } } else { //PPC城市 $hzBrokerId = intval(Bll_Broker_BrokerCheckInfo::getHzBrokerIdByAjkBrokerId($brokerId)); //定价房源信息 $fixedProInfos = Bll_House_FixedPro::getInstance()->getBrokerHzFiexdProInfo($hzBrokerId); if (empty($fixedProInfos)) { return array(); } foreach ($fixedProInfos as $fixedProVal) { $newFixedProInfos[$fixedProVal->proid] = array($fixedProVal->proid, $fixedProVal->created); $updateTimeArr[$fixedProVal->proid] = $fixedProVal->created; } } } //判断需要过滤的房源ID是否在推广房源信息中 if (!empty($filterProIds)) { foreach ($filterProIds as $filterProKey => $filterProId) { if (empty($newFixedProInfos[$filterProId])) { //不在在线推广房源中,则释放 unset($filterProIds[$filterProKey]); } else { //过滤ID,因为补充逻辑肯定是补充不在过滤ID中的房源 unset($newFixedProInfos[$filterProId]); unset($updateTimeArr[$filterProId]); } } } return $filterProIds; }
public function handlePost() { $this->request = APF::get_instance()->get_request(); $brokerId = $this->request->getBrokerId(); $cityId = $this->request->getBrokerCityId(); $params = $this->request->get_parameters(); $params['broker_id'] = $brokerId; $result = array(); try { if ($this->action == 'edit') { $houseInfo = Bll_House_EsfEdit::getHouseBaseInfo($this->houseId); /** 违规房源不可以编辑 */ if (isset($houseInfo['isIllegal']) && $houseInfo['isIllegal']) { $this->redirect2Result(Const_PublishCode::UNKNOWN_ERROR, 'ajk', 'edit', $this->houseId, '已违规房源不可编辑'); } $result = Bll_House_EsfEdit::saveHouseInfo($brokerId, $cityId, $this->houseId, $params); } if ($this->action == 'publish') { $result = Bll_House_EsfPublish::saveHouseInfo($brokerId, $params, $this->isComboBroker); if ($result['status'] == 'ok') { $this->houseId = $result['houseId']; } } /** 委托房源发布 */ if ($this->action == 'commission') { $result = Bll_House_EsfCommission::saveHouseInfo($brokerId, $cityId, $this->commissionId, $params, $this->isComboBroker); if ($result['status'] == 'ok') { $this->houseId = $result['houseId']; } } if ($result['status'] != 'ok') { $this->redirect2Result(Const_PublishCode::PUBLISH_PROP_ERROR, 'ajk', $this->action, $this->houseId, $result['info']); } } catch (Exception $e) { $params['brokerId'] = self::$intBrokerID; APF::get_instance()->get_nlogger()->log(__CLASS__, $params); $this->redirect2Result(Const_PublishCode::PUBLISH_PROP_ERROR, 'ajk', $this->action, $this->houseId, $e->getMessage()); } /** 立即推广 */ if (isset($params['broker_action']) && $params['broker_action'] == 'publish') { /** 套餐推广 */ if ($this->isComboBroker) { $spreadResult = Bll_Combo_HouseRelation::houseStartComboSpreadV2($brokerId, $cityId, array($this->houseId), Bll_Combo_HouseRelation::SITE_TYPE_AJK); if ($spreadResult['status'] != 1) { switch ($spreadResult['status']) { /** 没有套餐 */ case -1: case -2: $this->redirect2Result(Const_PublishCode::SPREAD_PROP_NO_COMBO, 'ajk', $this->action, $this->houseId, $spreadResult['msg']); break; /** 套餐未生效 */ /** 套餐未生效 */ case -3: $this->redirect2Result(Const_PublishCode::SPREAD_PROP_COMBO_ACTIVE, 'ajk', $this->action, $this->houseId, $spreadResult['msg']); break; /** 推广房源数已满 */ /** 推广房源数已满 */ case -4: case -5: $this->redirect2Result(Const_PublishCode::SPREAD_PROP_COMBO_LIMIT, 'ajk', $this->action, $this->houseId, $spreadResult['msg']); break; default: $this->redirect2Result(Const_PublishCode::SPREAD_PROP_COMBO_FAIL, 'ajk', $this->action, $this->houseId, $spreadResult['msg']); } } } else { /** 定价推广 */ if ($this->action == 'edit') { /** 定价推广失败 房源已经推广 */ if (BLL_Plan_EsfPropFixedPlanRelation::isHouseOnline($cityId, $this->houseId)) { $this->redirect2Result(Const_PublishCode::SPREAD_PROP_PLAN_IN, 'ajk', $this->action, $this->houseId, '房源已经推广'); } } $fixPlanList = BLL_Plan_EsfPropFixedPlanRelation::getBrokerValidPlan($brokerId); if (empty($fixPlanList)) { $this->redirect2Result(Const_PublishCode::UNKNOWN_ERROR, 'ajk', $this->action, $this->houseId, '获取定价计划信息失败'); } $fixPlan = $fixPlanList[0]; /** 定价推广失败 已经超出推广房源上限 */ if (!Bll_Broker_HzBroker::ajkPpcBrokerCanSpreadHouse($cityId, $brokerId)) { $this->redirect2Result(Const_PublishCode::SPREAD_PROP_OUT_LIMIT, 'ajk', $this->action, $this->houseId, '已经超出推广房源上限'); } $spreadResult = Bll_Ppc_ServiceAPI::fixPlanAddHouse($brokerId, $this->houseId, $fixPlan['id'], '23532'); if (isset($spreadResult['status'])) { if ($spreadResult['status'] != 'ok') { $this->redirect2Result(Const_PublishCode::API_ERROR, 'ajk', $this->action, $this->houseId, $spreadResult['info']); } } else { $this->redirect2Result(Const_PublishCode::API_ERROR, 'ajk', $this->action, $this->houseId, '系统繁忙(推广房源超时)'); } /** 定价推广失败 计划已经手动停止 */ if ($fixPlan['viewTime'] == 1861891200) { /** 定价推广失败 认证未通过 */ $brokerCheckState = Bll_Broker_BrokerCheckInfo::getCheckStateByBrokerId($brokerId); if ($brokerCheckState != 1) { $this->redirect2Result(Const_PublishCode::SPREAD_PROP_AUDITED_ERROR, 'ajk', $this->action, $this->houseId, '认证未通过'); } $this->redirect2Result(Const_PublishCode::SPREAD_PROP_HANDLE_STOP, 'ajk', $this->action, $this->houseId, '计划已经手动停止'); } /** 定价推广失败 账户余额不足,充值后自动推广 */ if ($fixPlan['viewTime'] == 1893427200) { $this->redirect2Result(Const_PublishCode::SPREAD_PROP_BALANCE_ERROR, 'ajk', $this->action, $this->houseId, '账户余额不足,充值后自动推广'); } } /** 推广成功 */ $this->redirect2Result(Const_PublishCode::HOUSE_SPREAD_SUCCESS, 'ajk', $this->action, $this->houseId); } /** 发布成功 */ $this->redirect2Result(Const_PublishCode::HOUSE_SAVE_SUCCESS, 'ajk', $this->action, $this->houseId); }
/** * 手动暂停二手房经纪人的定价计划 * * @param int $brokerId * @param int $cityId * @param array $fixPlan */ private function stopAjkFixPlan($brokerId, $cityId, $fixPlan) { $this->logMsg(sprintf('二手房经纪人[%d - %d]的定价计划,处理开始。', $cityId, $brokerId)); $currentTimestamp = time(); $data = array('houseId' => 0, 'planId' => 0, 'brokerId' => $brokerId, 'cityId' => $cityId, 'type' => 207, 'remark' => '切新端口,暂停定价计划', 'flag' => 0, 'addDate' => time(), 'dealRemark' => '', 'operateId' => 0, 'from' => __METHOD__, 'siteType' => 1); $this->logMsg(json_encode($fixPlan)); /** * 经纪人的计划,已经被手动停止 */ if ($fixPlan['viewTime'] == 1861891200) { $this->logMsg(sprintf('二手房经纪人[%d - %d]的计划[%d - %d]已经手动停止,不处理。', $cityId, $brokerId, $fixPlan['id'], $fixPlan['viewTime'])); return; } /** * 经纪人的计划,在推广中 */ if ($fixPlan['viewTime'] <= $currentTimestamp) { $this->logMsg(sprintf('二手房经纪人[%d - %d]的计划[%d - %d]推广中。', $cityId, $brokerId, $fixPlan['id'], $fixPlan['viewTime'])); } /** * 经纪人的计划,因账户没钱停止 */ if ($fixPlan['viewTime'] == 1893427200) { $this->logMsg(sprintf('二手房经纪人[%d - %d]的计划[%d - %d]因账户没钱停止。', $cityId, $brokerId, $fixPlan['id'], $fixPlan['viewTime'])); } if (false == BLL_Plan_EsfPropFixedPlanRelation::stopFixPlanByHand($fixPlan['id'])) { $this->logMsg(sprintf('二手房经纪人[%d - %d]的计划[%d - %d]手动暂停失败。', $cityId, $brokerId, $fixPlan['id'], $fixPlan['viewTime'])); return; } $this->logMsg(sprintf('二手房经纪人[%d - %d]的计划[%d - %d]手动暂停成功。', $cityId, $brokerId, $fixPlan['id'], $fixPlan['viewTime'])); if ($fixPlan['viewTime'] > $currentTimestamp) { $this->logMsg(sprintf('二手房经纪人[%d - %d]的计划[%d - %d]已经停止,不通知上下架。', $cityId, $brokerId, $fixPlan['id'], $fixPlan['viewTime'])); return; } /** * 记录上下架队列 */ $data['planId'] = $fixPlan['id']; if (!Model_House_UpDown_Task::create($data, date('Ymd'))->save()) { $this->logMsg(sprintf('%s 记录上下架队列失败。', json_encode($data))); } else { $this->logMsg(sprintf('%s 记录上下架队列成功。', json_encode($data))); } $this->logMsg(sprintf('二手房经纪人[%d - %d]的定价计划,处理结束。', $cityId, $brokerId)); }
/** * 获取页面的初始化信息 * * @param int $brokerId * @param int $cityId * @param int $houseId * @param AJKRequest $request * @throws Exception * @return array */ public static function preparePageParam($brokerId, $cityId, $houseId, $request) { /** 获取房源发布&编辑页面的示例URL */ $pageParams = Bll_House_EsfPublish::getExampleURL($cityId); /** 是否需要显示备案信息 */ $pageParams['houseRecordNumberConfig'] = Bll_House_EsfPublish::getHouseRecordNumberConfig($cityId); $pageParams['priceMentionUrl'] = Bll_House_EsfPublish::getPriceMentionUrl($cityId); $pageParams['publishHouseProtocolUrl'] = Bll_House_EsfPublish::getPublishHouseProtocolUrl($cityId); $pageParams['brokerId'] = $brokerId; $pageParams['cityId'] = $cityId; $pageParams['houseId'] = $houseId; /** 装修情况 */ $pageParams['fitmentList'] = Model_House_FitmentType::getFitment($cityId); /** 房屋类型 */ $pageParams['useTypeList'] = Model_Community_UseType::getUseTypeByCityId($cityId); /** 房屋朝向 */ $pageParams['orientateList'] = APF::get_instance()->get_config('house_orientate', 'house'); /** 获取小区和房源公共标签 */ $pageParams['privateTagList'] = Bll_House_EsfPublish::getPrivateTagList(); /** 获取上传图片服务器 */ $pageParams['uploadImgService'] = Bll_House_EsfPublish::getUploadImageServer(); $pageParams['picData'] = static::getHouseImageEx($brokerId, $houseId); /** 最低首付配置 */ $miniPayDownConfig = Bll_House_EsfPublish::getMiniPayDownConfig($cityId); $houseInfo = Bll_House_EsfEdit::getHouseBaseInfo($houseId); $pageParams['houseInfo'] = $houseInfo; if ($houseInfo['commissionType'] == 2 || $houseInfo['commissionType'] == 3) { $commissionInfo = Bll_House_EsfCommission::getCommissionByBrokerHouseId($houseId, $brokerId); $commissionHouseInfo = Bll_House_EsfCommission::getCommissionHouseInfo($commissionInfo['house']); $pageParams['commissionHouseInfo'] = $commissionHouseInfo; } $selectTagList = Model_House_AjkPrivateTag::getHouseTagById($houseInfo['ProPrivateTag']); foreach ($pageParams['privateTagList']['commTag'] as &$commTag) { if (in_array($commTag['tagId'], $houseInfo['ProPrivateTag'])) { $commTag['enable'] = false; } } foreach ($pageParams['privateTagList']['houseTag'] as &$subType) { foreach ($subType as &$houseTag) { if (in_array($houseTag['tagId'], $houseInfo['ProPrivateTag'])) { $houseTag['enable'] = false; } } } $pageParams['selectTagList'] = $selectTagList; $pageParams['canSpread'] = true; $pageParams['brokerActionTip'] = '推广房源已满,只能保存到未推广房源'; $pageParams['houseIsSpreading'] = false; if (Bll_Broker_HzBroker::isPpcBroker($brokerId)) { $pageParams['houseIsSpreading'] = BLL_Plan_EsfPropFixedPlanRelation::isHouseOnline($cityId, $houseId); if (!$pageParams['houseIsSpreading']) { $pageParams['canSpread'] = Bll_Broker_HzBroker::ajkPpcBrokerCanSpreadHouse($cityId, $brokerId); } else { $pageParams['canSpread'] = false; } } if (Bll_Broker_HzBroker::isComboBroker($brokerId)) { $pageParams['houseIsSpreading'] = false; $houseRelation = Bll_Combo_HouseRelation::getOnlineRelationByHouseId($houseId, Bll_Combo_HouseRelation::SITE_TYPE_AJK); if (!empty($houseRelation)) { $pageParams['houseIsSpreading'] = true; $pageParams['canSpread'] = false; } if (!$pageParams['houseIsSpreading']) { $checkCanSpreadResult = Bll_Combo_HouseRelation::housePublishComboCheck($brokerId, $cityId, Bll_Combo_HouseRelation::SITE_TYPE_AJK); $pageParams['canSpread'] = $checkCanSpreadResult['status'] == 1; $pageParams['brokerActionTip'] = $checkCanSpreadResult['msg']; } } return array_merge($pageParams, $miniPayDownConfig); }
public function handle_request_internal() { if (!Bll_City::isShowCaseCity(static::$intBrokerCityID)) { $this->redirect('/user/combo/brokerhome'); exit; } $objRequest = APF::get_instance()->get_request(); $cityID = self::$BrokerInfo['BaseInfo']['CITYID']; $objRequest->set_attribute('PayType', self::$BrokerInfo['BaseInfo']['PAYTYPE']); $tmp = array('cityId' => $cityID, 'status' => 1, 'startDate' => date('Ymd')); $cityPrice = Bll_Broker_ConfigCityPrice::getInstance()->getCityPrice($tmp, Const_ShowcaseOrders::SALE_DB); $todayPrice = round($cityPrice->discountPrice / 100, 2); $intBrokerID = $objRequest->getBrokerId(); $userId = $objRequest->getUserId(); $data = array('brokerId' => $intBrokerID); $orderinfo = Bll_Broker_ShowcaseOrders::getInstance()->getBrokerOrders($data, $this->db); if (!$orderinfo) { $this->toManage('/ajkbroker/showcase/esf/'); } $lavedays = ceil((strtotime($orderinfo->endDate) - strtotime(date('Ymd'))) / 3600 / 24); if ($orderinfo->isStop == 1 || $lavedays < 0) { $order_status = 'stop'; } else { $objRequest->set_attribute('lavedays', $lavedays); $objRequest->set_attribute('lastday', date('Y-m-d', strtotime($orderinfo->endDate))); $order_status = 'open'; } $objRequest->set_attribute('order_status', $order_status); $objRequest->set_attribute('todayPrice', $todayPrice); $params = APF::get_instance()->get_request()->get_parameters(); $days = intval($params['days']); //status=2是停止,status=1是续费 if ($params['status'] == 2) { if ($orderinfo->isStop == 0) { $stopstatus = Bll_Broker_ShowcaseOrders::getInstance()->stopBrokerOthers($orderinfo, $cityPrice->discountPrice, $this->db); if ($stopstatus['status']) { $this->toManage(); } else { $this->toError($stopstatus['msg']); } } else { $msg = '订单类型不能操作'; $this->toError($msg); } } elseif ($params['status'] == 1 && $days >= 1) { $BrokerMoney = Bll_Broker_ShowcaseOrders::getInstance()->getBrokerMoney($userId); if ($BrokerMoney < $todayPrice) { $this->toError(Const_ShowcaseOrders::MONEY_NOT_ENOUGH); } $Continueorder = Bll_Broker_ShowcaseOrders::getInstance()->continueBrokerOthers($orderinfo, $days, $cityPrice->discountPrice, $this->db); if ($Continueorder['status']) { $this->toManage(); } else { $this->toError($Continueorder['msg']); } } elseif ($params['status'] == 3) { $proIds = array(); if (!empty($params['rooms'])) { $proIds = explode(';', $params['rooms']); $filterProIds = Bll_Broker_ShowcaseAdSetPro::getInstance()->filterProIds($intBrokerID, $cityID, $this->db, $proIds); //有些房源不在线上展示 if (count($filterProIds) != count($proIds)) { $this->toError('有些房源没在线上推广,操作失败!'); } $res = Bll_Broker_ShowcaseAdSetPro::getInstance()->insertAdProsInfo($intBrokerID, $cityID, $proIds, $this->db); if (!$res['status']) { $this->toError($res['msg']); } else { //插入成功,跳转至管理页面 if ($orderinfo->isStop == 0) { $log = array(); $log['brokerId'] = $orderinfo->brokerId; $log['cityId'] = $orderinfo->cityId; $log['endDate'] = $orderinfo->endDate; $log['startDate'] = $orderinfo->startDate; $log['opType'] = Const_ShowcaseOrders::OPTYPE_6; $log['totalDays'] = ceil((strtotime($orderinfo->endDate) - strtotime($orderinfo->startDate)) / 3600 / 24) + 1; $log['createTime'] = time(); Bll_Broker_ShowcaseOrders::getInstance()->insertSetLog($log, $this->db); } $this->toManage(); } } } $orderCreated = date('Ymd', $orderinfo->createTime); if ($orderCreated < date('Ymd')) { $click = Bll_Broker_ShowcaseOrders::getInstance()->getBrokerClick($intBrokerID, date('Ymd', strtotime('-1 days')), $this->db); if (!$click->quantityCount) { $objRequest->set_attribute('YClick', 0); } else { $objRequest->set_attribute('YClick', $click->quantityCount); } $objRequest->set_attribute('IS_YClick', true); } $isCombo = Bll_Combo_HouseRelation::isComboCity($cityID); if ($isCombo['data']) { $comboList = Bll_Combo_HouseRelation::getHouseRelations($intBrokerID, Bll_Combo_HouseRelation::SITE_TYPE_AJK, 1); if (!empty($comboList)) { if (count($comboList) >= Const_ShowcaseOrders::SALE_PRO_MAX_COUNT) { $fixedProInfosCnt = Const_ShowcaseOrders::SALE_PRO_MAX_COUNT; } else { $fixedProInfosCnt = count($comboList); } } else { $fixedProInfosCnt = 0; } $proInfo = Bll_Broker_ShowcaseAdSetPro::getInstance()->getBrokerAdSalePropInfo($intBrokerID); $proIds = Bll_Broker_ShowcaseOrders::getInstance()->getObjFieldInfo($proInfo, 'propId'); $proInfos = Bll_House_EsfHouse::getHouseInfo($proIds, $cityID); $proList = Bll_Broker_ShowcaseAdSetPro::getInstance()->initComboEsfProData($proInfos, $comboList); } else { //获取经纪人计划 $brokerPlanInfo = BLL_Plan_EsfPropFixedPlanRelation::get_instance()->getBrokerEsfOnlinePlan($intBrokerID); if (!empty($brokerPlanInfo)) { //计划数据不为空 //计划IDs $planIds = Bll_Broker_ShowcaseOrders::getInstance()->getObjFieldInfo($brokerPlanInfo, 'id'); //定价推广房源 $fixedProInfos = Bll_Fixedspread_AjkFixedSpread::getFixedOnlineProByPlanIds($cityID, $planIds); $proIdsc = Bll_Broker_ShowcaseOrders::getInstance()->getObjFieldInfo($fixedProInfos, 'proId'); $proInfosc = Bll_House_EsfHouse::getHouseInfo($proIdsc, $cityID); if (!empty($proInfosc)) { if (count($proInfosc) >= Const_ShowcaseOrders::SALE_PRO_MAX_COUNT) { $fixedProInfosCnt = Const_ShowcaseOrders::SALE_PRO_MAX_COUNT; } else { $fixedProInfosCnt = count($proInfosc); } } else { $fixedProInfosCnt = 0; } } else { $fixedProInfosCnt = 0; } $proInfo = Bll_Broker_ShowcaseAdSetPro::getInstance()->getBrokerAdSalePropInfo($intBrokerID); $proIds = Bll_Broker_ShowcaseOrders::getInstance()->getObjFieldInfo($proInfo, 'propId'); $proInfos = Bll_House_EsfHouse::getHouseInfo($proIds, $cityID); $proStatus = Bll_Fixedspread_AjkFixedSpread::getFixedProBy($cityID, $proIds); $proList = Bll_Broker_ShowcaseAdSetPro::getInstance()->initEsfProData($proInfos, $proStatus, $planIds); } if (count($proList) > $fixedProInfosCnt) { $fixedProInfosCnt = count($proList); } $objRequest->set_attribute('type', 'ajk'); $objRequest->set_attribute('index', 2); //精选推广开关 $isChoice = Bll_City::isChoiceCity($cityID); $objRequest->set_attribute('isChoice', $isChoice); $objRequest->set_attribute('fixedProInfosCnt', $fixedProInfosCnt); $objRequest->set_attribute('proList', $proList); return 'Showcase_EsfManage'; }