/** * 精选推广(for job) * 计算排名 * 更新计划状态(坑位里面的异动房源更新状态) * 通知solr(坑位里面的异动房源通知solr) * 记房源日志(坑位里面的房源异动日志) */ public static function choiceSpread($params = array()) { // 检查参数 $checkParams = self::checkParams($params); if (!$checkParams['status']) { return $checkParams; } // 获取信息,组装$params $joinParams = self::joinParams($params); if (!$joinParams['status']) { return $joinParams; } $all_return = array(); if (!isset($params['type'])) { $params['type'] = 401; } if (!self::isPassSpread($params['blockId'], $params['priceId'])) { // 写入排队日志 if ($params['type'] = 401) { $data = self::build_prop_log($params, 13, $params['planId'] . "精选推广;精选排队中", $params['brokerId']); if (!Model_Log_HouseLogNew::create($data, date('Ymd'))->save()) { return Bll_HzPropBll::build_return(0, array("精选房源(" . $params['proId'] . ")排队日志写入失败")); } else { $all_return[] = "精选房源{$params['proId']}排队日志写入"; } //查询定价计划是否推广中 $fixPlanProInfo = Model_Plan_HzPlanning::getBrokerPro($params['proId'], Const_HzPlan::SPREAD_TYPE); if (!empty($fixPlanProInfo) && $fixPlanProInfo[0]['is_valid'] == Const_HzPlan::SPREAD) { //定价推广 $proStatus = Const_HzStatus::ONLINE; //推广 } else { $proStatus = $fixPlanProInfo[0]['is_valid'] == Const_HzPlan::UPPERLIMIT ? Const_HzStatus::NOCASH : Const_HzStatus::MANUALLY; //非推广 } //更新房源状态 Dao_Broker_HzProp::change_prop_status($params['proId'], $proStatus); //更新房源的状态 } return Bll_HzPropBll::build_return(1, $all_return); } // 更新状态 // Dao_Broker_HzPlan::update_planning($params['planId'], 1); Model_Plan_HzPlanning::updatePropPlanStatusByPlanId($params['planId'], Const_HzPlan::SPREAD); //更新关系表的状态 Bll_HzBidPlan::updatePlanStatus($params['planId'], Const_HzPlan::SPREAD); //更新计划的状态 Dao_Broker_HzProp::change_prop_status($params['proId'], Const_HzStatus::ONLINE); //更新房源的状态 // 通知solr Dao_Broker_HzProp::into_prop_lucene($params['proId'], $params['cityId'], 1); Dao_Broker_HzProp::add_updown_log($params['proId'], $params['planId'], Const_HzStatus::GOONLINE, Const_HzLog::BIDPLANSTART); $data = self::build_prop_log($params, 14, "精选房源推广", $params['brokerId']); if (!Model_Log_HouseLogNew::create($data, date('Ymd'))->save()) { return Bll_HzPropBll::build_return(0, array("精选房源(" . $params['proId'] . ")变更为精选推广失败")); } else { $all_return[] = "精选房源{$params['proId']}变更为精选推广"; } return Bll_HzPropBll::build_return(1, $all_return); }
/** * 获取经纪人推广定价房源信息 * @param $brokerId * @param int $planType * @param int $isValid * @return array */ public function getBrokerHzFiexdProStatus($proIds) { return Model_Plan_HzPlanning::getBrokerPro($proIds); }