コード例 #1
0
 /**
  * 加入好盘直通车开关
  * @return bool
  */
 public function chkHpOpen()
 {
     //--------------------好盘开关----my全部引用,故写在此处,待拆开------------//
     apf_require_class("BLL_Property_PropSpread");
     $objSpread = new BLL_Property_PropSpread();
     $bolHPOpen = false;
     if ($objSpread->checkHpSwitcher() !== false) {
         $bolHPOpen = true;
     }
     //为了page下homebase.php要用
     APF::get_instance()->get_request()->set_attribute("bolHPOpen", $bolHPOpen);
     return $bolHPOpen;
 }
コード例 #2
0
ファイル: GetRank.php プロジェクト: emilymwang8/ajk-broker
 /**
  * params brokerid token nameprice comm_id
  * return rank 排名
  */
 public function handle_request_internal()
 {
     $params = $this->_params;
     if (!isset($params['brokerId'])) {
         return Util_MobileAPI::error(Const_APIStatus::E_BROKER_PARAM_MISS);
     } else {
         $broker_id = $params["brokerId"];
     }
     if (!isset($params["cityId"])) {
         return Util_MobileAPI::error(Const_APIStatus::E_PARAM_CITYID_MISS);
     } else {
         $cityid = $params["cityId"];
     }
     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));
     }
     $objBLL = new BLL_Property_PropSpread();
     $arrRank = array();
     $commid = $params['commId'];
     $act = 'desire';
     $propId = $params['propId'];
     $offer = isset($params['offer']) ? $params['offer'] : 0;
     $offer = 100 * $offer;
     $arrPropInfo = $objBLL->getPropInfoBll($propId, $cityid);
     $priceTotle = $arrPropInfo['PROPRICEINT'] - 0.1;
     $priceInt = $objBLL->getPriceIntLimit($cityid, $priceTotle, 0, $commid, $arrPropInfo['TRADETYPE'], 1);
     if ($act == "research") {
         if (isset($priceInt) && !empty($priceInt)) {
             $hpratio = isset($params['hpratio']) ? $params['hpratio'] : 0;
             if ($arrPropInfo['TRADETYPE'] == 1) {
                 $rstRank = $objBLL->getPpcSaleRankBll($propId, $commid, $priceInt['minPrice'], $priceInt['maxPrice'], $hpratio);
                 $arrRank[] = array("minPrice" => $priceInt['minPrice'], "maxPrice" => $priceInt['maxPrice'], "rank" => $rstRank);
             }
         }
         if ($arrRank) {
             $return = array();
             $return["status"] = "ok";
             $return["data"] = $arrRank;
             return $return;
         } else {
             return Util_MobileAPI::error(Const_APIStatus::E_CALL_API_ERROR);
         }
     } else {
         // 此处是个坑,客户端不接受-1的值所以取消这个步骤
         //            $objBLL->jgGuSuan($propId);
         //            if ($rstJgGS) {
         //                APF::get_instance()->get_response()->set_content_type("application/json");
         //                echo -1;
         //                exit;
         //            }
         if (isset($priceInt) && !empty($priceInt)) {
             $commScore = $objBLL->getCommScoreBll($arrPropInfo['COMMID']);
             if ($arrPropInfo['TRADETYPE'] == 1) {
                 $score = $objBLL->getPropMass($propId, $cityid, $arrPropInfo);
                 $userActionScore = $objBLL->getUserActionScore($propId, $cityid);
                 $hpratio = $objBLL->getHpraio($offer, $score, $userActionScore);
             } else {
                 $score = $objBLL->getRentQuality($propId, $cityid, $arrPropInfo);
                 $hpratio = $objBLL->getRentHpraio($offer, $score);
             }
             if ($arrPropInfo['TRADETYPE'] == 1) {
                 $hpratioNorm = $objBLL->getPpcNormHpratio($hpratio, $arrPropInfo['COMMID'], $propId, false, $arrPropInfo, $priceInt['minPrice'], $priceInt['maxPrice']);
                 $hpratio = round($commScore * $hpratioNorm, 5);
                 $rstRank = $objBLL->getPpcDeseirSaleRankBll($propId, $commid, $priceInt['minPrice'], $priceInt['maxPrice'], $hpratio);
                 $arrRank[] = array("minPrice" => $priceInt['minPrice'], "maxPrice" => $priceInt['maxPrice'], "rank" => $rstRank);
             }
         }
         if ($arrRank) {
             $return = array();
             $return["status"] = "ok";
             $return["data"] = $arrRank[0]["rank"];
             return $return;
         } else {
             return Util_MobileAPI::error(Const_APIStatus::E_CALL_API_ERROR);
         }
     }
 }