示例#1
0
 /**
  * 房源取消套餐推广
  * @return array
  */
 public function do_removePropFromCombo()
 {
     $this->params['proIds'] = is_array($this->params['proIds']) ? $this->params['proIds'] : explode(',', $this->params['proIds']);
     if (!Bll_Combo_HouseRelation::houseStopComboSpread($this->brokerId, $this->cityId, $this->params['proIds'], Bll_Combo_HouseRelation::SITE_TYPE_HZ)) {
         return Util_GlobalFunc::buildReturn(0, '房源取消套餐推广失败');
     }
     return Util_GlobalFunc::buildReturn(1, '房源取消套餐推广成功');
 }
示例#2
0
 public function handle_request_combo()
 {
     $brokerId = $this->brokerId;
     $propIds = $this->_params['propIds'];
     $cityId = $this->cityId;
     if (!is_array($propIds)) {
         $propIds = strstr($propIds, ",") === false ? array($propIds) : explode(',', $propIds);
     }
     // 房源有效性验证等
     $prop = Model_House_HzProp::getPropsByPropIds($propIds);
     if (empty($prop)) {
         throw new Exception('房源不存在');
     }
     if (!Bll_Combo_HouseRelation::houseStopComboSpread($brokerId, $cityId, $propIds, Bll_Combo_HouseRelation::SITE_TYPE_HZ)) {
         Util_MobileAPI::error_tmp('-1', '套餐推广取消失败');
     }
     return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('msg' => '套餐推广取消成功'));
 }
示例#3
0
 /**
  * 经纪人手动停止套餐推广
  *
  * @param int $brokerId
  * @param int $cityId
  * @param array $params
  * @return array
  */
 private function houseStopSpreadAction($brokerId, $cityId, $params)
 {
     $houseIds = is_array($params['houseIds']) ? $params['houseIds'] : explode(',', $params['houseIds']);
     $realHouseIds = $this->removeInvalidateHouseId($brokerId, $houseIds, $cityId, true);
     if (empty($realHouseIds)) {
         return $this->buildResponse('error', $houseIds, '请选择要取消推广的房源。');
     }
     if (Bll_Combo_HouseRelation::houseStopComboSpread($brokerId, $cityId, $realHouseIds, Bll_Combo_HouseRelation::SITE_TYPE_AJK)) {
         return $this->buildResponse('ok', $realHouseIds, sprintf('成功取消推广 %d 套房源。', count($realHouseIds)));
     }
     return $this->buildResponse('error', $realHouseIds, '取消套餐推广失败。');
 }
示例#4
0
 /**
  * 房源手动取消套餐推广
  */
 public function do_cancelHouseCombo()
 {
     $tempHouseIds = explode(',', $this->params['houseIds']);
     $houseIds = array();
     foreach ($tempHouseIds as $k => $houseId) {
         $house = Bll_House_JpHouseInfo::getHouseInfoById($houseId);
         if ($house['base']['memberId'] != $this->jpBrokerId) {
             continue;
         }
         $houseComboInfo = Model_Combo_HouseRelation::data_access('jp')->filter('houseId', $house['base']->id)->find_only();
         if ($houseComboInfo->state != Model_Combo_HouseRelation::ENUM_HOUSE_ONLINE) {
             continue;
         }
         $houseIds[] = $houseId;
     }
     if (empty($houseIds)) {
         $this->outPut(0, '房源信息有误,请重新选择房源');
     }
     if (Bll_Combo_HouseRelation::houseStopComboSpread($this->brokerId, $this->cityId, $tempHouseIds, Bll_Combo_HouseRelation::SITE_TYPE_JP)) {
         $this->outPut(1, '房源停止推广成功');
         /*
         foreach($houseIds as $houseId) {
             $houseIdx = Model_House_JpHouseIdx::data_access()
                 ->filter('id', $houseId)
                 ->filter('isDelete', Model_House_JpHouseIdx::ENUM_IS_DELETE_NO)
                 ->find_only();
             //删除竞价 更新数据 通知solr后端JOB做
             if($houseIdx->bidSpreadId) {
                 $plan = Model_Plan_Jp::data_access()
                     ->filter('id', $houseIdx->bidSpreadId)
                     ->find_only();
                 if($plan) {
                     $houseIdx->bidSpreadId = 0;
                     $houseIdx->updateTime = date('Y-m-d H:i:s');
                     $houseIdx->save();
         
                     if($plan->status = Model_Plan_Jp::ENUM_STATUS_ONLINE) {
                         //发送结算
                         $params = array();
                         $params['spread_id'] = $plan->id;
                         $params['log_status'] = 7;
                         Bll_Plan_Bid_JpSettlement::getInstance()->settlement($params,'bid');
                     }
         
                     $plan->status = Model_Plan_Jp::ENUM_STATUS_OVER;
                     $plan->isDelete = 1;
                     $plan->updateTime = date('Y-m-d H:i:s');
                     $plan->save();
         
                     //记录房源操作
                     $intTitle = Const_CrmHouseLog::V_OPERATION_TITLE_OUT_SHELVES;
                     $intComment = Const_CrmHouseLog::V_OPERATION_COMMENT_HOUSE_SPREAD_OFFLINE;
                     Bll_Log_JpHouse::getInstance()->logHouseOperation($houseIdx->id,$houseIdx->memberId,$intTitle,$intComment);
                     //TO 初始化房源统计日志
                     Bll_House_JpBwAnalysis::getInstance()->openSaveBluewhaleHouse($houseIdx->id,date('Y-m-d'),$houseIdx->bidSpreadId,$plan->type);
                 }
             }
         }
         */
     } else {
         $this->outPut(0, '房源停止推广失败');
     }
 }