/** * 110 房源图片信息变更 * * <ol> * <li> * 查询房源信息是否存在<br> * 如果不存在,返回结束<br> * 如果有效,记录房源编辑日志<br> * </li> * * <li> * 查询房源计划关系<br> * 如果不存在,返回结束<br> * 如果存在,continue<br> * </li> * * <li> * 查询计划信息<br> * 如果计划不在推广,返回结束<br> * 如果计划正在推广或者第二天推广, 房源更新日志<br> * </li> * </ol> */ public static function change_prop_pic($params) { $returnLog = array(); array_push($returnLog, "队列(" . json_encode($params['id']) . ")开始处理"); if (empty($params['pro_id'])) { array_push($returnLog, "房源ID为空"); return self::build_return(1, $returnLog); } if (empty($params['city_id'])) { array_push($returnLog, "城市ID为空"); return self::build_return(1, $returnLog); } //获取房源信息 $propBll = new BLL_Property_Property(); $propInfo = $propBll->getPropBaseInfoById($params['pro_id']); if (isset($propInfo[-9999])) { array_push($returnLog, "获取数据库中房源信息失败"); return self::build_return(0, $returnLog); } if (empty($propInfo)) { array_push($returnLog, "房源信息为空"); return self::build_return(1, $returnLog); } //房源信息存在写入房源编辑信息 $data = self::build_prop_log($params, 2, "房源编辑" . ";队列表id为" . $params['id'], $params['broker_id']); if (!Model_Log_HouseLogNew::create($data, date('Ymd'))->save()) { array_push($returnLog, "房源编辑日志写入失败"); return self::build_return(0, $returnLog); } array_push($returnLog, "房源编辑日志写入"); //查询房源计划关系 $relationBll = new Bll_FixedSpread_PropFixedPlanRelation(); $relationInfo = $relationBll->getProSpreadRelationByProId($params['pro_id'], $params['city_id']); if (empty($relationInfo)) { array_push($returnLog, "房源计划关系为空"); return self::build_return(1, $returnLog); } /** * 修正房源的计划id */ if (empty($params['plan_id'])) { $params['plan_id'] = $relationInfo['PlanId']; } //获取计划信息 $planBll = new Bll_Fixedspread_AjkFixedSpread(); $planInfo = $planBll->getStaticPlanById($params['plan_id']); if (empty($planInfo)) { array_push($returnLog, "计划信息为空"); return self::build_return(1, $returnLog); } $planStatus = $planBll->getFixedPlanStatus($planInfo['Status'], $planInfo['ViewTime']); //1. 刪除 2.推广中 3.第二天推广 4.账户没钱停止 5.手动停止 switch ($planStatus) { case 1: array_push($returnLog, "计划状态已被置为删除"); break; case 2: case 3: //房源更新日志 $data = self::build_prop_log($params, 4, "房源更新" . ";队列表id为" . $params['id'], $params['broker_id']); if (!Model_Log_HouseLogNew::create($data, date('Ymd'))->save()) { array_push($returnLog, "房源更新日志写入失败"); return self::build_return(0, $returnLog); } array_push($returnLog, "房源更新日志写入"); break; case 4: array_push($returnLog, "计划状态为账户没钱停止"); break; case 5: array_push($returnLog, "计划状态为手动停止"); break; default: break; } return self::build_return(1, $returnLog); }
/** * 判断房源推广状态 * @param $cityId * @param $brokerId * @param $houseIds * @return array * add by xiongjianxu */ public static function getHouseOnLineInfo($cityId, $brokerId, $houseIds) { $result = array(); if (empty($cityId) || empty($brokerId) || empty($houseIds)) { return $result; } if (!is_array($houseIds)) { $houseIds = array($houseIds); } //是否为新端口城市 $comboInfo = Bll_Combo_HouseRelation::isComboCity($cityId); if ($comboInfo['code'] == 200) { if ($comboInfo['data'] == 0) { //ppc城市 //定价推广确认 $bllProperty = new BLL_Property_Property(); // 定价房源的数据 $staticPro = $bllProperty->getSaleStaticProInfoByProId($cityId, $houseIds, $brokerId); foreach ($staticPro as $key => $value) { $result[$key] = true; //$key为houseId } } else { //新端口城市 $houseComboArr = Bll_Combo_HouseRelation::getHouseRelation($brokerId, $cityId, $houseIds, Bll_Combo_HouseRelation::SITE_TYPE_AJK); foreach ($houseComboArr as $value) { if ($value['state'] < Model_Combo_HouseRelation::ENUM_COMBO_OFFLINE) { $result[$value['houseId']] = true; } else { $result[$value['houseId']] = false; } } } } return $result; }
/** * 获取一条房源信息【考虑验证有效性】 * @param $p_intPropID * @param bool $bolRefreshCache * @return array|null */ public function getOnePropDetail($p_intPropID = 0, $bolRefreshCache = false) { apf_require_class("BLL_Property_Property"); $objPropertyBL = new BLL_Property_Property(); #房源信息 $prop = $objPropertyBL->getPropertyBaseInfo($p_intPropID, $bolRefreshCache); #加入房源扩展信息 //$prop['EXTEND'] = $objPropertyBL->getPropertyExtendInfo($prop['TRADETYPE'], $prop['PROID'], true); return empty($prop) ? array() : $prop; }
/** * 房产季,取消标签 702 * ajk * @param $params * @return array */ public static function activityResRemoveAjk($params) { $returnLog = array(); array_push($returnLog, "队列(" . json_encode($params['id']) . ")开始处理"); if (empty($params['pro_id'])) { array_push($returnLog, "房源ID为空"); return self::build_return(1, $returnLog); } //获取房源信息 $propBll = new BLL_Property_Property(); $propInfo = $propBll->getPropBaseInfoById($params['pro_id']); if (isset($propInfo['-9999'])) { array_push($returnLog, "获取数据库中房源信息失败"); return self::build_return(0, $returnLog); } if (empty($propInfo)) { array_push($returnLog, "房源信息为空"); return self::build_return(1, $returnLog); } //房源日志写入 房产季取消标签 23 $data = self::build_prop_log($params, Const_ProLogType::LOG_ACTIVITY_RES_REMOVE, "房产季活动取消标签" . ";队列表id为" . $params['id'], $params['broker_id']); $data['siteType'] = 1; if (!Model_Log_HouseLogNew::create($data, date('Ymd'))->save()) { array_push($returnLog, "房产季活动取消标签日志写入失败"); return self::build_return(0, $returnLog); } array_push($returnLog, "房产季活动取消标签日志写入"); return self::build_return(1, $returnLog); }