Beispiel #1
0
 public function handle_request_internal()
 {
     //判断房源是否定价 拿propid去static_price_relation 查PlanId 再去static_price_plan表中查定价信息
     $propId = $this->_params['propId'];
     $cityId = $this->_params['cityId'];
     //好丑陋。。。。。。好无奈。。。。。。
     //委托房源自动转发停用,为了app能够展示报错信息。。。
     if (empty($propId)) {
         $this->_params['apiDebug'] = 1;
         return array('status' => Const_APIStatus::RETURN_CODE_ERROR, 'errcode' => '0000', 'message' => '委托房源自动转发功能已停用;若要发布请手动发布');
     }
     $relation = Model_Plan_AjkFixRelation::getRelationByProId($propId, $cityId);
     $result['status'] = 'ok';
     $data['totalClicks'] = $data['todayClicks'] = $data['clickPrice'] = 0;
     $data['planId'] = '';
     if (!empty($relation)) {
         if ($relation['status'] == Model_Plan_AjkFixRelation::STATUS_NORMAL) {
             $data['status'] = 1;
             //房源在定价推广中
         } else {
             $data['status'] = 0;
             //未推广
         }
         $plan = Model_Plan_EsfFixedPlan::getValidStaticPricePlanById($relation['planId']);
         $data['planId'] = $plan[0]['id'];
         if (!empty($plan)) {
             //房源在定价推广中
             //房源点击量
             $proClickDao = new DAO_My_Ppc_PlanOpe();
             $proClickInfo = $proClickDao->getProClick($propId, strtotime("20120901"));
             if (!empty($proClickInfo)) {
                 if (isset($proClickInfo[$propId])) {
                     $data['totalClicks'] = $proClickInfo[$propId];
                 }
                 $data['todayClicks'] = $proClickInfo['todayClicks'];
             }
         }
     } else {
         $data['status'] = 0;
         //未推广
     }
     //获取点击单价
     $houseInfo = Bll_House_EsfHouse::getHouseBaseInfo($propId, $cityId);
     if (!empty($houseInfo)) {
         $proPriceInt = $houseInfo[0]['proPriceInt'];
         $priceArr = DAO_My_Ppc_UtilTool::getPriceInterval($cityId, $proPriceInt - 0.01);
         if (!empty($priceArr)) {
             $data['clickPrice'] = round($priceArr['price'], 2);
         }
     }
     $data['clickPriceUnit'] = '元';
     $result['data'] = $data;
     return $result;
 }
Beispiel #2
0
 public function getPriceIntLimit($cityId = 0, $priceInt = 0, $areaid = 0, $commid = 0, $tradetype = 1, $limit = 1)
 {
     apf_require_class("DAO_My_Ppc_UtilTool");
     $daoUtilTool = new DAO_My_Ppc_UtilTool();
     if ($tradetype == 1) {
         $rstPrice = $daoUtilTool->getPriceInterval($cityId, $priceInt, 0, $commid, $tradetype, $limit);
     } else {
         $rstPrice = $daoUtilTool->getPriceInterval($cityId, $priceInt, $areaid, 0, $tradetype, $limit);
     }
     return $rstPrice;
 }