public function handle_request_internal() { APF::get_instance()->get_response()->set_content_type('text/html', 'utf-8'); $this->ctx = APF::get_instance()->get_request()->get_parameters(); $this->ctx['ajkBrokerId'] = APF::get_instance()->get_request()->getBrokerId(); $this->ctx['cityId'] = APF::get_instance()->get_request()->getBrokerCityId(); // 入参校验 if (!$this->ctx['code'] || !$this->ctx['site'] || !$this->ctx['act']) { $this->ctx['code'] = Const_PublishCode::HOUSE_PARAM_COMPLETE; } $msgs = APF::get_instance()->get_config('message', 'publishmessage'); if (!$this->ctx['message']) { $this->ctx['message'] = $msgs[$this->ctx['code']]; } // 头标题 $this->ctx['titleMsg'] = in_array($this->ctx['code'], array(Const_PublishCode::HOUSE_SPREAD_SUCCESS, Const_PublishCode::SPREAD_PROP_HANDLE_STOP, Const_PublishCode::SPREAD_PROP_BALANCE_ERROR, Const_PublishCode::SPREAD_PROP_OUT_LIMIT, Const_PublishCode::SPREAD_PROP_AUDITED_ERROR, Const_PublishCode::SPREAD_PROP_PLAN_IN, Const_PublishCode::SPREAD_PROP_BUDGET_OVER, Const_PublishCode::SPREAD_PROP_NO_COMBO, Const_PublishCode::SPREAD_PROP_COMBO_ACTIVE, Const_PublishCode::SPREAD_PROP_COMBO_LIMIT, Const_PublishCode::SPREAD_PROP_COMBO_FAIL, Const_PublishCode::PSEUDO_ERROR)) ? '推广' : '保存'; $this->ctx['isSuccess'] = $this->ctx['code'] < 200; $this->ctx['titleMsg'] .= $this->ctx['isSuccess'] ? '成功' : '失败'; $this->prepareMessage(); $this->ctx['isChoiceCity'] = Bll_City::isChoiceCity(static::$intBrokerCityID); $this->ctx['isShowCaseCity'] = Bll_City::isShowCaseCity(static::$intBrokerCityID); if ($this->ctx['site'] == 'jp') { $this->ctx['isShowCaseCity'] = false; } $this->prepareOthers(); //$this->ctx['debug'] && (print_r($this->ctx) && die); $this->setAttributes($this->ctx); return 'House_Result'; }
public function handle_request_internal() { $brokerId = $this->_params['brokerId']; $propId = $this->_params['propId']; $budget = $this->_params['budget']; $offer = $this->_params['offer']; $city_info = Dao_Broker_BrokerInfo::get_broker_base_info(intval($this->_params['brokerId'])); if (!Bll_City::isBidCity($city_info['CITYID'])) { $error_code = Const_HzErrorInfo::NOBIDCITY; return array('status' => 'error', 'errcode' => $error_code, 'message' => Bll_HzFixPlan::get_message_from_code($error_code)); } $planInfo = $this->get_hpplan_info($propId); $post = array('brokerId' => $brokerId, 'propId' => $propId, 'budget' => $budget * 100 - $planInfo['budget'], 'offer' => $offer * 100, 'from' => APF::get_instance()->get_config('java_api_from')); $url = '/service-ppc/rest/hp/updHPlan'; $data = Util_CallAPI::get_data_from_java_api($url, $post); if ($data['data']['status'] === 'ok') { $ret = array('status' => 'ok', 'data' => array()); } else { $errcode = $data['data']['code']; $translate_errcode = $this->my_err_code($errcode); if ($translate_errcode === FALSE) { $ret = Util_MobileAPI::error_tmp($data['data']['code'], $data['data']['info']); } else { $ret = Util_MobileAPI::error($translate_errcode); } } return $ret; }
public function get_view() { $params = $this->get_params(); $this->assign_data('menu', $params['menu']); $this->assign_data('index', $params['index']); //添加商业地产店铺城市列表 $this->set_city_list(); $this->assign_data('managespace_city_list', $this->managespace_city_list); $request = APF::get_instance()->get_request(); $cityId = $request->getBrokerCityId(); $this->assign_data('cityId', $cityId); $this->assign_data('isNewCommunityApplyCity', Bll_City::isNewCommunityApplyCity($cityId)); //明星中介相关 try { apf_require_class('Bll_Broker_StarIntermediary'); $starBll = new Bll_Broker_StarIntermediary($cityId); $starIsOpen = $starBll->checkCityIfOpen(); $brokerId = APF::get_instance()->get_request()->getBrokerId(); $starInfo = $starBll->getBrokerNewestInfo($brokerId); if (empty($starInfo['broker'])) { $starIsOpen = 0; } $this->assign_data('starIsOpen', $starIsOpen); } catch (Exception $e) { //todo 不做任何处理,不展示明星中介内容 } return "BrokerSideNav"; }
public function handle_request_internel() { $params = $this->getParam(); if ($params['page'] == 'userinfo') { //编辑用户信息 $this->_edit_user($params); } $userinfoObj = Bll_OA::get_OA_info_by_userid($params['userid']); $userinfo = Tool_Array::daoresult_obj_to_arr($userinfoObj->data); if (empty($userinfo)) { $userinfoObj = Bll_OA::get_OA_info_by_username($params['username']); $userinfo = Tool_Array::daoresult_obj_to_arr($userinfoObj->data); if (empty($userinfo)) { $cUrl = $this->build_url("/error/"); $this->response->redirect($cUrl); exit; } } $usergroup = BLL_Authority::get_user_info_by_user_id($params['userid']); $citysArr = explode(',', $usergroup['citys']); $groupid = $usergroup['group_id']; $citys = $this->_init_user_city($citysArr); $citydata = Bll_City::get_city_data(); $citydata = $this->_init_data_city($citydata, 'CityId'); //获取所有角色 $group_all = Bll_Authority::get_all_group_info(); $this->setAttribute('groupid', $groupid); $this->setAttribute('groupall', $group_all); $this->setAttribute('citydata', $citydata); $this->setAttribute('citys', $citys); $this->setAttribute('userinfo', $userinfo); $this->setAttribute('params', $params); return 'Permissions_UserInfo'; }
public function handle_request_internal() { /** * @var $request AJKRequest */ $request = apf::get_instance()->get_request(); if (!Bll_City::isBidCity($request->getBrokerCityId())) { echo '{"status":"error", "msg":"不是竞价城市"}'; return; } $planId = intval($request->get_parameter('plan_id')); if ($planId <= 0) { $planId = intval($request->get_parameter('planId')); } if ($planId <= 0) { echo '{"status":"error"}'; return; } $planInfo = Bll_Plan_Bid_AjkPlan::getPlanByPlanId($planId); if (empty($planInfo) || !isset($planInfo['brokerId']) || $planInfo['brokerId'] != static::$intBrokerID) { echo json_encode(array('status' => 'error', 'msg' => '不能停止别人的计划')); return; } if (!isset($planInfo['status']) || ($planInfo['status'] == 1 || $planInfo['status'] == 11)) { $remark = sprintf('MODIFYTIME:%d=>%dSTATUS:%d=>%dSTOPTIME:%d=>%d', $planInfo['modifytime'], time(), $planInfo['status'], 3, $planInfo['stoptime'], time()); echo json_encode($this->stopPlan(static::$intBrokerID, static::$intBrokerCityID, $planId, $remark)); } elseif ($planInfo['tradestatus'] == 2 && in_array($planInfo['status'], array(3, 4, 5, 6, 7, 8, 9, 10))) { $remark = sprintf('MODIFYTIME:%d=>%dSTATUS:%d=>%d', $planInfo['modifytime'], time(), $planInfo['status'], 2); echo json_encode($this->deletePlan(static::$intBrokerID, static::$intBrokerCityID, $planId, $remark)); } else { echo '{"status":"ok","msg":"status error"}'; } return; }
public function handle_request_internal() { $brokerId = $this->_params['brokerId']; // 判断经纪人是否存在 $broker = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId); $hzBrokerId = Model_Broker_MainBusiness::getHzBrokerIdByAjkBrokerId($brokerId); if (!$hzBrokerId || !$broker) { throw new Exception_Broker_NotFound('BrokerId: ' . $brokerId); } // 判断城市是否开通竞价业务 $cityId = $broker['cityId']; if (!Bll_City::isBidCity($cityId)) { return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('todayClicks' => 0, 'todayConsume' => 0, 'todayConsumeUnit' => '元', 'totalProps' => 0)); } // 获取今日房源点击和消费记录 $clicksInfo = Model_Stats_PropClick::getClickInfoByBrokerId($hzBrokerId, $cityId); // 统计今日竞价点击和消费 $todayClicks = 0; $todayConsume = 0; foreach ($clicksInfo as $objClick) { $todayClicks += $objClick->bid_cnum; $todayConsume += $objClick->bid_cost; } // 获取竞价房源数 $bidPropNum = Bll_HzBidPlan::get_broker_bidprop_count($hzBrokerId); return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('todayClicks' => $todayClicks, 'todayConsume' => Util_Formatter::formatTodayConsume($todayConsume / 100), 'todayConsumeUnit' => '元', 'totalProps' => $bidPropNum)); }
public function handle_request_internal() { if (!$this->isBrokerLogin()) { echo json_encode(array('error' => -5, 'msg' => '请先登入!')); return false; } /** * @var $request AJKRequest */ $request = APF::get_instance()->get_request(); $cityId = $request->getBrokerCityId(); if (!Bll_City::isChoiceCity($cityId)) { echo json_encode(array('error' => -1, 'msg' => '您所在城市未开通精选业务!')); return false; } $params = $request->get_parameters(); if (!isset($params['act']) || empty($params['act'])) { echo json_encode(array('error' => -1, 'msg' => '参数错误!')); return false; } $action_method = 'do_' . $params['act']; if (!method_exists($this, $action_method)) { echo json_encode(array('error' => -1, 'msg' => '方法未实现。')); return false; } $result = call_user_func(array($this, $action_method), $params); APF::get_instance()->get_response()->set_content_type("application/json"); echo json_encode($result); return false; }
public function handle_request_internal() { $brokerId = $this->_params['brokerId']; $cityId = $this->_params['cityId']; //二手房 $ajk_ppc_info = Bll_BrokerInfoApp::get_broker_ppc_info($brokerId); //租房 $hz_ppc_info = Bll_BrokerInfoApp::get_broker_ppc_info_hz($brokerId, $cityId); //经纪人基础信息 $brokerBaseInfo = Bll_BrokerInfoApp::get_broker_baseinfo_simple($brokerId); try { $chatInfo = Bll_Mobile_ChatInfoBll::getInstance()->getChatInfo($brokerId, 1); $chatId = $chatInfo['data']['chatId']; $twoCodeIcon = $chatInfo['data']['twoCodeIcon']; } catch (Exception $e) { $chatId = ''; $twoCodeIcon = ''; } //get bid flg for city $choiceCityFlag = Bll_City::isChoiceCity($cityId); // chat_token $info = array('phone' => $brokerBaseInfo['phone'], 'user_id' => $chatInfo['data']['chatId'], 'device' => array('app_name' => APF::get_instance()->get_config('java_api_from'), 'os' => $this->_params["o"], 'macid' => $this->_params["macid"], 'udid2' => $this->_params["udid2"])); $privateKey = APF::get_instance()->get_config('aes_private_key', 'mobile_api'); $iv = APF::get_instance()->get_config('aes_iv', 'mobile_api'); $token3rd = Util_CryptUtil::aes_encode($privateKey, $iv, $info); $ajk_dic_info = array('ajkClick' => $ajk_ppc_info['ajkClick'], 'ajkConsume' => $ajk_ppc_info['ajkConsume'], 'ajkFixHouse' => $ajk_ppc_info['ajkFixHouse'], 'ajkBidHouseNum' => $ajk_ppc_info['ajkBidHouseNum'], 'ajkNotFixHouseNum' => $ajk_ppc_info['ajkNotFixHouseNum'], 'haveAjk' => intval($ajk_ppc_info['ajkNotFixHouseNum']) + intval($ajk_ppc_info['ajkFixHouse'][0]['fixNum']) > 0 ? 1 : 0); $hz_dic_info = array('hzClick' => $hz_ppc_info['hzClick'], 'hzConsume' => $hz_ppc_info['hzConsume'], 'hzFixHouse' => $hz_ppc_info['hzFixHouse'], 'hzBidHouseNum' => $hz_ppc_info['hzBidHouseNum'], 'hzNotFixHouseNum' => $hz_ppc_info['hzNotFixHouseNum'], 'haveHz' => intval($hz_ppc_info['hzNotFixHouseNum']) + intval($hz_ppc_info['hzFixHouse'][0]['fixNum']) > 0 ? 1 : 0); if ($choiceCityFlag) { $ajk_dic_info['ajkBidHouseNum'] = 0; $hz_dic_info['hzBidHouseNum'] = 0; } return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('ajkDataDic' => $ajk_dic_info, 'hzDataDic' => $hz_dic_info, 'brokerName' => $brokerBaseInfo['brokerName'], 'phone' => $brokerBaseInfo['phone'], 'chatId' => $chatId, 'twoCodeIcon' => $twoCodeIcon, 'tokenChat' => $token3rd)); }
/** * init env * @param AJKRequest $request * @param $out * @throws Exception */ private static function initEnv($request, &$out) { $out['debug'] = isset($_GET['debug']) ? true : false; $out['cityId'] = $request->getBrokerCityId(); $out['ajkBrokerId'] = $request->getBrokerId(); $out['isComboBroker'] = Bll_Broker_HzBroker::isComboBroker($out['ajkBrokerId']); $route_matches = $request->get_router_matches(); $out['proId'] = trim($route_matches[2], "/ \t\n\r\v"); if (!$out['proId']) { throw new Exception('缺少房源Id参数'); } $jpMemberInfo = Model_Broker_JpBroker::getJpBrokerInfoByAjkBrokerId($out['ajkBrokerId']); // 获取金铺brokerId $out['jpBrokerId'] = $jpMemberInfo->id; // 是否精选 $out['isChoiceCity'] = Bll_City::isChoiceCity($out['cityId'], Const_Site::JINPU); $out['isBidCity'] = Bll_City::isBidCity($out['cityId'], Const_Site::JINPU); if ($out['isChoiceCity'] || $out['isBidCity']) { $out['bidTip'] = $out['isChoiceCity'] ? '精选' : '竞价'; $out['bidUrl'] = $out['isChoiceCity'] ? '/ajkbroker/user/choice/set/jp/' . $out['proId'] : '/jinpu/bid/new/' . $out['proId']; } $multicity = APF::get_instance()->get_config("cities", "multicity"); $out['cityName'] = $multicity[$out['cityId']]; // 获取经纪人信息 if (!($out['brokerInfo'] = Model_Broker_JpBroker::data_access()->filter('id', $jpMemberInfo->id)->get_row())) { throw new Exception('获取金铺经纪人信息失败:hzBrokerId [' . $out['hzBrokerId'] . ']'); } }
/** * @param AJKRequest $request * @param array $out * @throws Exception */ public static function initEnv($request, &$out) { $out['debug'] = isset($_GET['debug']) ? true : false; $out['cityId'] = $request->getBrokerCityId(); $out['ajkBrokerId'] = $request->getBrokerId(); $brokerInfo = Model_Broker_JpBroker::getJpBrokerInfoByAjkBrokerIdEx($out['ajkBrokerId']); if (empty($brokerInfo)) { throw new Exception('获取金铺经纪人信息失败:ajkBrokerId [' . $out['ajkBrokerId'] . ']'); } $out['brokerInfo'] = $brokerInfo; // 获取金铺brokerId $out['jpBrokerId'] = $brokerInfo['id']; // 是否精选 $out['isChoiceCity'] = Bll_City::isChoiceCity($out['cityId'], Const_Site::JINPU); $out['isBidCity'] = false; $out['isShowCaseCity'] = Bll_City::isShowCaseCity($out['cityId'], Const_Site::JINPU); $out['bidTip'] = '精选'; //经纪人全部有效房源 $out['houses'] = Bll_House_JpHouseInfo::getAllHouseInfoEx($out['ajkBrokerId']); $out['houseIds'] = array(); foreach ($out['houses'] as $infoP) { $base = $infoP['base']; $info = $infoP['info']; $type = $infoP['houseType']; $propertyId = in_array($type, array(1, 2)) ? $info['buildingId'] : $info['propertyId']; $out['houseIds'][$type][$base['id']] = array('houseId' => $base['id'], 'propertyId' => $propertyId); } $out['publishUrl'] = Bll_Broker_Combo_ManageJp::buildHousePublishUrl(); }
/** * init env * @param AJKRequest $request * @param array $out * @throws Exception */ private static function initEnv($request, &$out) { $out['debug'] = isset($_GET['debug']) ? true : false; $out['cityId'] = $request->getBrokerCityId(); $out['ajkBrokerId'] = $request->getBrokerId(); $route_matches = $request->get_router_matches(); $out['proId'] = trim($route_matches[2], "/ \t\n\r\v"); if (!$out['proId']) { throw new Exception('缺少房源Id参数'); } // 获取好租brokerId $out['hzBrokerId'] = Model_Broker_HzMapping::get_hz_broker_id($out['ajkBrokerId']); // 是否精选 $out['isChoiceCity'] = Bll_City::isChoiceCity($out['cityId'], Const_Site::HAOZU); $out['isBidCity'] = false; // 获取经纪人信息 if (!($out['brokerInfo'] = Model_Broker_HzUsersSearch::getUserInfoByUserId($out['hzBrokerId']))) { throw new Exception('获取好租经纪人信息失败:hzBrokerId [' . $out['hzBrokerId'] . ']'); } // 身份是否通过 $out['isPassVerify'] = Bll_Broker_HzBroker::isPassVerify($out['brokerInfo']['profileVerify']); // 获取套餐相关 //$out['brokerLimitInfo'] = Bll_Broker_BrokerLimit::getPpcBrokerLimitInfo($out['ajkBrokerId'], Bll_Broker_BrokerLimit::PPC_BROKER_LIMIT_ZF_SITE); // 获取经纪人主推房源 $out['mainSpreadProIds'] = array(); $mainSpreads = Model_Broker_AdPropsShowRent::getInstance()->getBrokerAdPropInfo($out['ajkBrokerId']); if ($mainSpreads) { foreach ($mainSpreads as $v) { $out['mainSpreadProIds'][$v->propId] = $v->propId; } } }
public function handle_request_internal() { $brokerId = $this->_params['brokerId']; //检查经纪人是否存在 $brokerInfo = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId); if (!$brokerInfo) { throw new Exception_Broker_NotFound('BrokerId: ' . $brokerId); } // 判断城市是否开通竞价业务 $cityId = $brokerInfo->cityId; if (!Bll_City::isBidCity($cityId)) { return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('todayClicks' => 0, 'todayConsume' => 0, 'todayConsumeUnit' => '元', 'totalProps' => 0)); } $data = array('todayClicks' => 0, 'todayConsume' => 0, 'todayConsumeUnit' => '元'); $datei = date('Ymd'); //获取经纪人竞价推广某天的点击和花费信息 $allClickAndCostInfo = Model_Plan_HpProStatsDay::getBrokerClickAndCostDay($brokerId, $cityId, $datei); foreach ($allClickAndCostInfo as $row) { $data['todayClicks'] += $row->cnum; $data['todayConsume'] += $row->amount / 100; } $data['todayConsume'] = Util_Formatter::formatTodayConsume($data['todayConsume']); //获取计划数 $data['totalProps'] = Model_Plan_EsfAjkPropSpread::getPlanCountByBroker($brokerId, Model_Plan_EsfAjkPropSpread::DEFAULTVERSION); return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => $data); }
public function handle_request_internal() { //组织POST参数 $params = array(); if (!isset($this->_params['brokerId'])) { return Util_MobileAPI::error(Const_APIStatus::E_BROKER_PARAM_MISS); } else { $broker_id = $this->_params["brokerId"]; } if (!isset($this->_params["cityId"])) { return Util_MobileAPI::error(Const_APIStatus::E_PARAM_CITYID_MISS); } if (!isset($this->_params["propId"])) { return Util_MobileAPI::error(Const_APIStatus::E_PROP_ID_MISS); } if (!isset($this->_params["offer"])) { return Util_MobileAPI::error(Const_APIStatus::E_PROP_BID_PRICE_MISS); } if (!Bll_City::isBidCity($this->_params["cityId"])) { $error_code = Const_HzErrorInfo::NOBIDCITY; return array('status' => 'error', 'errcode' => $error_code, 'message' => Bll_HzFixPlan::get_message_from_code($error_code)); } $search = new Util_SearchUtil(); $prop = Bll_HzProp::get_prop($this->_params["propId"]); $blockid = $prop['blockid']; $price = $prop['pricenum']; $price_block = Bll_HzBidPlan::get_price_block($this->_params["cityId"], $price); $ajkid = Bll_HzProp::get_subregion_id($prop['commId'], $this->_params["propId"]); $rank = $search->getHpRankByProp($this->_params["cityId"], $ajkid, $this->_params["propId"], $price_block['LOWER'], $price_block['UPPER'], $this->_params['offer']); $return = array(); $return["status"] = "ok"; $return["data"] = $rank; return $return; }
/** * init env * @param $request * @param $out * @throws Exception */ private static function initEnv($request, &$out) { $out['debug'] = isset($_GET['debug']) ? true : false; $out['cityId'] = $request->getBrokerCityId(); $out['ajkBrokerId'] = $request->getBrokerId(); // 获取好租brokerId $out['hzBrokerId'] = Model_Broker_HzMapping::get_hz_broker_id($out['ajkBrokerId']); // 获取账户余额 $balance = Bll_Broker_HzBroker::getAccountInfo($out['ajkBrokerId'], 'balance'); if (!$balance['status']) { throw new Exception_BllErrorException($balance['msg']); } $out['validMoney'] = $balance['msg'] ? round($balance['msg'] / 100, 2) : 0; // 是否精选 $out['isChoiceCity'] = Bll_City::isChoiceCity($out['cityId'], Const_Site::HAOZU); $out['isBidCity'] = false; $out['isShowCaseCity'] = Bll_City::isShowCaseCity($out['cityId'], Const_Site::HAOZU); // 获取经纪人信息 if (!($out['brokerInfo'] = Model_Broker_HzUsersSearch::getUserInfoByUserId($out['hzBrokerId']))) { throw new Exception('获取好租经纪人信息失败:hzBrokerId [' . $out['hzBrokerId'] . ']'); } // 身份是否通过 $out['isPassVerify'] = Bll_Broker_HzBroker::isPassVerify($out['brokerInfo']['profileVerify']); // 获取套餐相关 $out['brokerLimitInfo'] = Bll_Broker_BrokerLimit::getPpcBrokerLimitInfo($out['ajkBrokerId'], Bll_Broker_BrokerLimit::PPC_BROKER_LIMIT_ZF_SITE); // 获取经纪人主推房源 $out['mainSpreadProIds'] = array(); $mainSpreads = Model_Broker_AdPropsShowRent::getInstance()->getBrokerAdPropInfo($out['ajkBrokerId']); if ($mainSpreads) { foreach ($mainSpreads as $v) { $out['mainSpreadProIds'][$v->propId] = $v->propId; } } }
public function handle_request_internal() { /** * @var $request AJKRequest */ $request = APF::get_instance()->get_request(); /** * @var $response AJKResponse */ $response = APF::get_instance()->get_response(); $response->set_content_type('application/json', 'utf-8'); if (!Bll_City::isComboCity($request->getBrokerCityId())) { echo json_encode(array('status' => 'error', 'msg' => '非套餐城市')); return false; } $params = $this->getParameters(); $routeMatches = $request->get_router_matches(); if (!isset($routeMatches[1])) { $action = 'NotFoundAction'; } else { $action = str_replace(' ', '', ucwords(str_replace('_', ' ', $routeMatches[1]))); $action = $action . 'Action'; } if (!method_exists($this, $action) || !is_callable(array($this, $action))) { $action = 'NotFoundAction'; } $cityId = $request->getBrokerCityId(); $brokerId = $request->getBrokerId(); $result = call_user_func(array($this, $action), $brokerId, $cityId, $params); echo json_encode($result); return false; }
public function handle_request_internal() { if (!Bll_City::isShowCaseCity(static::$intBrokerCityID)) { $this->outData(array(), 0); exit; } $this->apf = APF::get_instance(); $this->request = $this->apf->get_request(); $this->response = $this->apf->get_response(); $params = $this->request->get_parameters(); //经纪人ID $this->brokerId = self::$BrokerInfo['BaseInfo']['BROKERID']; // TODO 替换为其他的方式 //经纪人城市ID $this->cityId = self::$BrokerInfo['BaseInfo']['CITYID']; $type = $params['type']; switch ($type) { case 'esf': //二手房房源数据获取 $this->getBrokerEsfPro(); break; case 'zf': //租房房源数据获取 $this->getBrokerZfPro(); break; default: $this->outData(array(), 0); break; } }
public function handle_request_internal() { $brokerIds = explode(',', $this->_params['brokerIds']); $cityId = $this->_params['cityId']; $renovateTime = $this->_params['renovateTime']; //某时间以后创建的房源数量 $isComboCity = Bll_City::isComboCity($cityId); $propIds = array(); if ($isComboCity) { //如果是套餐城市 套餐房源表中 批量获取经纪人在线房源 $comboSpreadHouseList = Bll_Broker_Combo_ManageAjk::getComboSpreadHouseList($brokerIds, $cityId); $propIds = array_keys($comboSpreadHouseList); } else { //如果是定价城市 获取经纪人定价计划--获取有效计划房源关系 $fixSpreadPlanList = Bll_Plan_Fix_AjkPlan::getBrokerPlanList($brokerIds); //获取经纪人有效定价计划 计划表 $fixSpreadPlanIds = array_keys($fixSpreadPlanList); //获取有效计划房源关系 $relations = Bll_Plan_Fix_AjkPlan::getPropFixedPlanRelation($brokerIds, $cityId, $fixSpreadPlanIds); foreach ($relations as $relation) { $propIds[] = $relation['propId']; } } $propsInfos = Bll_House_EsfHouse::getHouseBaseInfoByGetAll($propIds, $cityId, array(), '', '', $renovateTime); $brokerNewPropNum = count($propsInfos); return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('brokerNewPropNum' => $brokerNewPropNum)); }
public function handle_request_internal() { $brokerId = $this->_params['brokerId']; $propId = $this->_params['propId']; $budget = $this->_params['budget']; $offer = $this->_params['offer']; //根据安居客经纪人ID获取好租经纪人ID $brokerId_hz = Bll_HzBroker::get_brokerid_by_ajk_brokerid($this->_params['brokerId']); if ($brokerId_hz) { $broker_info = Dao_Broker_HzPlan::get_hzbroker_info($brokerId_hz); if (!Bll_City::isBidCity($broker_info['cityid'])) { $error_code = Const_HzErrorInfo::NOBIDCITY; return array('status' => 'error', 'errcode' => $error_code, 'message' => Bll_HzFixPlan::get_message_from_code($error_code)); } } $plan_id = Bll_HzBidPlan::get_planid_by_propid($propId); //@todo 不明白为什么一定要用propid而不用计划id $ret_offer = Bll_HzBidPlan::change_bid_offer($plan_id, $offer); //修改出价 $ret_budget = Bll_HzBidPlan::change_bid_budget($plan_id, $budget); //修改预算 ----$new_amount 为需要增加的预算 $r = array(); if ($ret_offer['status'] && $ret_budget['status']) { $r = array('status' => 'ok', 'data' => array()); } else { if (!$ret_offer['status']) { $r = array('status' => 'error', 'errcode' => $ret_offer['msg'], 'message' => Bll_HzFixPlan::get_message_from_code($ret_offer['msg'])); } if (!$ret_budget['status']) { $r = array('status' => 'error', 'errcode' => $ret_budget['msg'], 'message' => Bll_HzFixPlan::get_message_from_code($ret_budget['msg'])); } } return $r; }
public function handle_request_internal() { if ($this->_params['offer']) { $post = array('brokerId' => $this->_params['brokerId'], 'budget' => $this->_params['budget'] * 100, 'offer' => $this->_params['offer'] * 100, 'propId' => $this->_params['propId']); } $city_info = Dao_Broker_BrokerInfo::get_broker_base_info(intval($this->_params['brokerId'])); if (!Bll_City::isBidCity($city_info['CITYID'])) { $error_code = Const_HzErrorInfo::NOBIDCITY; return array('status' => 'error', 'errcode' => $error_code, 'message' => Bll_HzFixPlan::get_message_from_code($error_code)); } if (!empty($this->_params['offer'])) { $offerStr = (string) $this->_params['offer']; if (strpos($offerStr, ".") !== false) { $offerArr = explode('.', $offerStr); if (strlen($offerArr[1]) > 1) { return Util_MobileAPI::error_tmp("3016", "竞价出价最小单位为角"); } } } $api_url = '/service-ppc/rest/hp/createHPlan'; $result = Util_CallAPI::get_data_from_java_api($api_url, $post); if ($result['data']['status'] == 'ok') { $return = array('status' => 'ok', 'data' => array()); } else { $return = Util_MobileAPI::error(self::changeJavaAPICodeToSelfCode($result['data']['code'])); } return $return; }
public function handle_request_internal() { $brokerId = $this->_params['brokerId']; $hzBrokerId = Model_Broker_MainBusiness::getHzBrokerIdByAjkBrokerId($brokerId); $brokerInfo = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId); if (!$brokerInfo) { throw new Exception_BrokerNotFoundException('经纪人不存在', Const_APIStatus::E_BROKER_NOT_EXISTS); } $cityId = $brokerInfo->cityId; if (!Bll_City::isChoiceCity($cityId, Const_Site::HAOZU)) { return array('status' => Const_APIStatus::RETURN_CODE_ERROR, 'errcode' => Const_APIStatus::E_NOT_CHOICE_CITY, 'message' => '非精选城市'); } $bllChoice = new Bll_Zufang_Choice(); $today = date('Ymd'); $choiceInfo = $bllChoice->get_choice_info($hzBrokerId, $today, $cityId); $todayClicks = intval($choiceInfo[0]['bidClicks']); $todayConsume = intval($choiceInfo[0]['bidConsume']) / 100; // 获取精选推广房源数(精选计划和房源一一对应) $plansIds = array(); $plans = $bllChoice->get_active_choice_plans($hzBrokerId, array(1, 13, 2, 3, 7, 8)); foreach ($plans as $plan) { $plansIds[] = $plan->id; } $props = array(); if ($plansIds) { $props = $bllChoice->get_prop($plansIds); } $totalProps = count($props); //将精选状态变化数目归零 $keyData = array('brokerId' => $brokerId, 'bizType' => Model_Mobile_PropRedDot::TYPE_CHOICE_STATUS); $data = array('num' => 0); Bll_Mobile_PropRedDot::getInstance()->updateData($keyData, $data); return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('todayClicks' => $todayClicks, 'todayConsume' => Util_Formatter::formatTodayConsume($todayConsume), 'todayConsumeUnit' => '元', 'totalProps' => $totalProps)); }
public function beforeHandlerRequest() { /** 不是套餐城市就直接返回 */ if (!Bll_City::isComboCity($this->cityId)) { $this->outPut(0, '未开通套餐业务'); exit; } }
public function handle_request_internal() { if (!Bll_City::isNewCommunityApplyCity(static::$intBrokerCityID)) { $this->redirect('/ajkbroker/broker/applygardener/?from=illegal_request'); } $params = $this->getParameters(); $page = isset($params['p']) ? max(1, $params['p']) : 1; $applyCommunityGardenerAd = Bll_Community_CommunityGardener::getCommunityGardenerApplyBannerAdInfo(static::$intBrokerCityID); if (!empty($applyCommunityGardenerAd)) { $this->setAttribute('applyCommunityGardenerAd', $applyCommunityGardenerAd[0]); } $houseCommunityInfo = Bll_Community_CommunityGardener::getBrokerOnlineHouseCommunityInfo(static::$intBrokerID, static::$intBrokerCityID, array('commId', 'commName', 'showDay', 'showDate')); $communityIds = $this->getCommunityIdFromHouseInfo($houseCommunityInfo); sort($communityIds, SORT_NUMERIC); $communityInfoList = array(); foreach ($communityIds as $communityId) { $communityInfo = Bll_Community_CommunityGardener::getCommunityDetail($communityId); /** 过滤掉隐藏小区 */ if ($communityInfo['baseInfo']['typeFlag'] == 0) { continue; } $communityInfoList[] = $communityInfo; } /** 移除完善小区 */ $canApplyCommunityList = $this->removeCompleteCommunity($communityInfoList); if (!empty($canApplyCommunityList)) { $communityCount = count($canApplyCommunityList); /** 如果当前页大于最大页数,则跳转至第一页 */ if ($page > ceil($communityCount / self::PAGE_SIZE)) { $this->redirect(BASE_URI . '/broker/applygardener2/?from=error_page_number'); } //usort($canApplyCommunityList, array($this, 'sortCommunity')); $communityList = array_slice($canApplyCommunityList, ($page - 1) * self::PAGE_SIZE, self::PAGE_SIZE); $communityIds = $this->getCommunityIdFromCommunityInfo($communityList); /** 获取小区的小区园丁状态 */ $communityStateInfoList = Bll_Community_CommunityGardener::getMultiCommunityApplyInfo($communityIds); /** 转换小区园丁的列表为以小区ID为key */ $communityStateInfoList = $this->changeCommunityStateInfoList2CommunityId($communityStateInfoList); /** TODO 拼接小区申请额外信息 */ $canApplyCommunityStateList = $this->initCommunityGardenerStateInfo($communityList, $communityStateInfoList, static::$intBrokerID); // if (!empty($canApplyCommunityStateList['gardenerIds'])) { // $gardenerInfoList = Bll_Community_CommunityGardener::getMultiBrokerInfo($canApplyCommunityStateList['gardenerIds'], array('brokerId', 'trueName')); // $this->setAttribute("gardenerInfos", $gardenerInfoList); // } /** 分页信息 */ $multiPageShow = false; if ($communityCount > self::PAGE_SIZE) { $multiPage = $this->getMultiPage(array('p' => $page), $communityCount, self::PAGE_COUNT, self::PAGE_SIZE); $multiPageShow = true; $this->setAttribute("multipage", $multiPage); } $this->setAttribute("commCount", $communityCount); $this->setAttribute("BrokerId", static::$intBrokerID); $this->setAttribute("multipageShow", $multiPageShow); $this->setAttribute("onlineCommInfos", $canApplyCommunityStateList['communityList']); } return 'Broker_CommunityApplyGardeners2'; }
public function beforeHandlerRequest() { if (!Bll_City::isBidCity($this->cityId, Const_Site::HAOZU)) { $this->outPut(-1, '未开通竞价业务'); } // 获取好租brokerId if (!($this->params['hzBrokerId'] = Model_Broker_HzMapping::get_hz_broker_id($this->brokerId))) { $this->outPut(-1, '获取好租信息失败'); } }
public function handle_request_internal() { $cityId = $this->_params['cityId']; $choiceCityFlag = Bll_City::isChoiceCity($cityId); if ($choiceCityFlag === false) { $return = array('business' => array(array('businessId' => V1_Common_GetMainBusinessController::RETURN_CODE_NUM_1, 'businessName' => V1_Common_GetMainBusinessController::RETURN_CODE_MSG_1))); } else { $return = array('business' => array(array('businessId' => V1_Common_GetMainBusinessController::RETURN_CODE_NUM_1, 'businessName' => V1_Common_GetMainBusinessController::RETURN_CODE_MSG_1), array('businessId' => V1_Common_GetMainBusinessController::RETURN_CODE_NUM_2, 'businessName' => V1_Common_GetMainBusinessController::RETURN_CODE_MSG_2))); } return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => $return); }
public function getTasks() { $condition = array(array('id', '>', $this->lastLogId), array('cityId', 'in', Bll_City::getCloseShowCaseCities()), array('status', '=', Const_ShowcaseOrders::STATUS_VALID)); $sort = array('id', 'asc'); if ($this->dataBase == Const_ShowcaseOrders::SALE_DB) { $tasks = Model_Broker_AdSetSale::getList($condition, $this->limit, $sort); } else { $tasks = Model_Broker_AdSetRent::getList($condition, $this->limit, $sort); } return $tasks; }
/** * init env * @param $request * @param $out * @throws Exception */ private static function initEnv($request, &$out) { $out['debug'] = isset($_GET['debug']) ? true : false; $out['cityId'] = $request->getBrokerCityId(); $out['ajkBrokerId'] = $request->getBrokerId(); // 获取好租brokerId //$out['hzBrokerId'] = Model_Broker_HzMapping::get_hz_broker_id($out['ajkBrokerId']); // 是否精选 $out['isChoiceCity'] = Bll_City::isChoiceCity($out['cityId'], Const_Site::HAOZU); $out['bidMessage'] = $out['isChoiceCity'] ? '精选' : '竞价'; }
public function handle_request_internal() { if (!Bll_City::isShowCaseCity(static::$intBrokerCityID)) { $this->redirect('/user/combo/brokerhome'); exit; } $this->apf = APF::get_instance(); $this->request = $this->apf->get_request(); $this->response = $this->apf->get_response(); $this->params = $this->request->get_parameters(); //回调地址 $r_url = base64_decode($this->params['r_url']); if (empty($r_url)) { $r_url = $_SERVER['HTTP_REFERER']; if (empty($r_url)) { $r_url = '/ajkbroker/showcase/zf'; } } $msg = $this->params['msg']; if (!$msg) { //没有报错信息,就是提示成功 $type = $this->params['type'] ? $this->params['type'] : Const_ShowcaseOrders::SALE_DB; //二手房经纪人ID $brokerId = self::$BrokerInfo['BaseInfo']['BROKERID']; if ($type == Const_ShowcaseOrders::SALE_DB) { //二手房 $proCountMax = Const_ShowcaseOrders::SALE_PRO_MAX_COUNT; $brokerAdProInfos = Bll_Broker_ShowcaseAdSetPro::getInstance()->getBrokerAdSalePropInfo($brokerId, true); $brokerAdInfo = Bll_Broker_ShowcaseOrders::getInstance()->getBrokerOrders(array('brokerId' => $brokerId), Const_ShowcaseOrders::SALE_DB); } else { //租房 $proCountMax = Const_ShowcaseOrders::RENT_PRO_MAX_COUNT; $brokerAdProInfos = Bll_Broker_ShowcaseAdSetPro::getInstance()->getBrokerAdRentPropInfo($brokerId, true); $brokerAdInfo = Bll_Broker_ShowcaseOrders::getInstance()->getBrokerOrders(array('brokerId' => $brokerId), Const_ShowcaseOrders::RENT_DB); } //订单信息不存在 if (empty($brokerAdInfo)) { APF::get_instance()->get_response()->redirect($r_url); } $dayCount = ceil((strtotime($brokerAdInfo->endDate) - strtotime($brokerAdInfo->startDate)) / 86400) + 1; $this->request->set_attribute('dayCount', $dayCount); $this->request->set_attribute('proCount', count($brokerAdProInfos)); $this->request->set_attribute('proCount', count($brokerAdProInfos)); $this->request->set_attribute('leftProCount', $proCountMax - count($brokerAdProInfos)); //橱窗价格 $tmp = array('cityId' => self::$BrokerInfo['BaseInfo']['CITYID'], 'status' => 1, 'startDate' => date('Ymd')); $cityPrice = Bll_Broker_ConfigCityPrice::getInstance()->getCityPrice($tmp, $type); $this->request->set_attribute('price', !empty($cityPrice->discountPrice) ? round($cityPrice->discountPrice / 100, 2) : 8); } //报错信息 $this->request->set_attribute('msg', $msg); $this->request->set_attribute('r_url', $r_url); return 'Showcase_Error'; }
public function handle_request_internal() { //根据安居客经纪人ID获取好租经纪人ID $brokerId = $this->_params['brokerId']; $brokerId_hz = Bll_HzBroker::get_brokerid_by_ajk_brokerid($this->_params['brokerId']); $city_id = $this->_params['cityId']; //get bid flg for city $choiceCityFlag = Bll_City::isChoiceCity($city_id, Const_Site::HAOZU); if ($choiceCityFlag) { return array('status' => 'ok', 'data' => array('propertyList' => array(), 'codeNum' => Const_HzErrorInfo::NOBIDCITY)); } $result = Bll_HzBidPlan::get_broker_bidprop($brokerId_hz, $city_id); if (!empty($result)) { $props = array(); foreach ($result as $key => $prop) { $prop_basic['id'] = $prop['proid']; $prop_basic['title'] = $prop['prop']['content_basic']['title']; $prop_basic['commId'] = $prop['prop']['content_basic']['commid']; $prop_basic['commName'] = $prop['prop']['content_basic']['commname']; $prop_basic['roomNum'] = $prop['prop']['content_basic']['roomnum']; $prop_basic['hallNum'] = $prop['prop']['content_basic']['hallnum']; $prop_basic['toiletNum'] = $prop['prop']['content_basic']['toilnetnum']; $prop_basic['area'] = round($prop['prop']['content_basic']['areanum']); $prop_basic['price'] = round($prop['prop']['content_basic']['pricenum']); $prop_basic['priceUnit'] = "元"; $prop_basic['bidStatus'] = $prop['plan']['status']; $prop_basic['index'] = $prop['rank']; $prop_basic['clickNum'] = $prop['clicks']; $prop_basic['offer'] = $prop['offer']; $prop_basic['budget'] = $prop['reconsume']; $prop_basic['yusuan'] = $prop['consume']; if ($prop['plan']['status'] != 1) { $prop_basic['yusuan'] = 20; $prop_basic['bidStatus'] = 3; //@todo 此处是个坑,后续要改 } //增加委托房源标签 $isEntrust = Bll_Zufang_Choice::isCommissionHouse($prop['proid'], $brokerId, Model_House_Commission::TYPE_RENT); if ($isEntrust) { $prop_basic['isEntrust'] = 1; } else { $prop_basic['isEntrust'] = 0; } $prop_basic['planId'] = $key; $props['propertyList'][] = $prop_basic; } } else { $props['propertyList'] = array(); } $ret = array('status' => 'ok', 'data' => $props); return $ret; }
public function handle_request_internal() { if (!Bll_City::isShowCaseCity(static::$intBrokerCityID)) { $this->outData(array(), 0); exit; } $this->apf = APF::get_instance(); $this->request = $this->apf->get_request(); $this->response = $this->apf->get_response(); $this->params = $this->request->get_parameters(); $this->brokerId = self::$BrokerInfo['BaseInfo']['BROKERID']; $this->userId = self::$BrokerInfo['BaseInfo']['USERID']; $this->getBrokerMoney(); }
public function handle_request_internal() { $mobile = $this->_params['mobile']; $password = $this->_params['password']; $checkPassword = $this->_params['checkPassword']; $truename = $this->_params['truename']; $cityId = $this->_params['cityId']; $mainBusiness = $this->_params['mainBusiness']; $companyId = $this->_params['companyId']; $storeId = $this->_params['storeId']; $blockId = $this->_params['blockId']; $ip = $this->_params['ip']; $is_rand_mobile = $this->_params['is_rand_mobile']; //验证数据 $checkReturn = $this->checkData($password, $checkPassword, $cityId, $mainBusiness); if ($checkReturn !== true) { return $checkReturn; } //调试用的代码 if ($is_rand_mobile == 1) { $mobile = substr(time(), 1, 7) . rand(1000, 9999); } #$areaInfo = Model_City_TypeCode::getAreaInfoByTypeId($blockId, $cityId); $areaInfo = Bll_Commtype_Api::getInfoByTypeIdAndCityId($blockId, $cityId); $post_data = array("j_password" => $password, "trueName" => $truename, "cityId" => $cityId, "areaCode" => $areaInfo['typeCode'], "companyId" => $companyId, "storeId" => $storeId, "userMobile" => $mobile, "channel" => 138, "regip" => $ip, "isPPC" => Bll_City::isFixCity($cityId) ? 'true' : 'false', "mainBussiness" => $mainBusiness); //打注册接口 $res = $this->register($post_data); if ($res['status'] == 'ok') { //设置主营业务 $mainBusinessId = $this->setMainBusiness($res['broker']['userId'], $res['broker']['brokerId'], $mainBusiness); if (!$mainBusinessId) { return array('status' => Const_APIStatus::RETURN_CODE_ERROR, 'errcode' => Const_APIStatus::E_SYS_ERR, 'message' => V1_RegisterController::MAIN_BUSINESS_FAIL); } //写主营业务log $mainBusinessLogId = $this->setMainBusinessLog($res['broker']['userId'], $res['broker']['brokerId'], $mainBusiness); if (!$mainBusinessLogId) { return array('status' => Const_APIStatus::RETURN_CODE_ERROR, 'errcode' => Const_APIStatus::E_SYS_ERR, 'message' => V1_RegisterController::MAIN_BUSINESS_LOG_FAIL); } //获取token $token = $this->createBrokerToken($res['broker']['brokerId'], $res['broker']['userName']); $sid = APF::get_instance()->get_config("sid", "login"); //单点登录 $registerBll = new Bll_Register(); $registerBll->singleSignon($mobile, $password, $sid); return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('brokerId' => $res['broker']['brokerId'], 'userId' => $res['broker']['userId'], 'userName' => $res['broker']['userName'], 'cityId' => $res['broker']['cityId'], 'mobile' => $res['broker']['userMobile'], 'trueName' => $res['broker']['trueName'], 'token' => $token)); } else { return array('status' => Const_APIStatus::RETURN_CODE_ERROR, 'errcode' => Const_APIStatus::E_JAVA_API_ERROR, 'message' => empty($res['info']) ? '请求超时' : $res['info']); } }