示例#1
0
 public function handle_request_internal()
 {
     $brokerId = $this->_params['brokerId'];
     $propIds = $this->_params['propIds'];
     $planId = isset($this->_params['planId']) ? $this->_params['planId'] : null;
     $hzBrokerId = Bll_HzBroker::get_brokerid_by_ajk_brokerid($brokerId);
     $propIds = explode(',', $propIds);
     // 转换成数组
     // 判断定价推广房源数量
     $fixPlans = Bll_HzFixPlan::get_broker_fixplans($hzBrokerId);
     if (empty($fixPlans)) {
         throw new Exception('计划不存在', Const_APIStatus::E_PLAN_NOTFOUND);
     }
     // 定价房源总数不能超过50套
     $fixPropNum = 0;
     foreach ($fixPlans as $planInfo) {
         $fixPropNum = $fixPropNum + $planInfo['prop_count'];
     }
     if ($fixPropNum + count($propIds) > 50) {
         return Util_MobileAPI::error(Const_APIStatus::E_PLAN_ERR_3014);
     }
     // 房源加入定价计划组
     if (is_null($planId)) {
         $planId = $fixPlans[0]['id'];
     }
     $ret = Bll_HzFixPlan::batchprop_into_fix($hzBrokerId, $propIds, $planId);
     if (!$ret['status']) {
         return Util_MobileAPI::error(Const_APIStatus::E_PLAN_PARAM_ERR);
     }
     return array('status' => 'ok', 'data' => array());
 }