Ejemplo n.º 1
0
 /**
  * 判断活动开关是否开启
  * @param $cityId
  * @param $siteId
  * @param $type
  * @return bool|string
  * @throws Exception_City_BizTypeNotFound
  */
 public static function isOnActivity($cityId, $siteId, $type)
 {
     $status = self::typeDefault($type) == Const_CityBizType::ON;
     $cityBizType = Model_City_BizType::getCitySiteBizType($cityId, $siteId, $type);
     $current = time();
     if ($current < strtotime($cityBizType['startTime'])) {
         $status = 'notStart';
     } elseif ($current > strtotime($cityBizType['endTime'])) {
         $status = 'end';
     } elseif ($current > strtotime($cityBizType['startTime']) && $current < strtotime($cityBizType['endTime'])) {
         $status = 'start';
     }
     return $status;
 }
Ejemplo n.º 2
0
 public function handle_request_internal()
 {
     if ($this->_params['demon']) {
         goto demon;
     }
     $brokerId = $this->_params['brokerId'];
     $houseId = $this->_params['propId'];
     $brokerInfo = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId);
     $cityId = $brokerInfo->cityId;
     //好丑陋。。。。。。好无奈。。。。。。
     //委托房源自动转发停用,为了app能够展示报错信息。。。
     if (empty($houseId)) {
         $this->_params['apiDebug'] = 1;
         return array('status' => Const_APIStatus::RETURN_CODE_ERROR, 'errcode' => '0000', 'message' => '委托房源自动转发功能已停用;若要发布请手动发布');
     }
     //是否显示精选概况 0 不显示; 1 正常显示
     $isDisplaySummary = 0;
     $bll = new BLL_Choice_EsfAPPAPIChoice();
     if (($data = $bll->getPropChoiceSummary($brokerId, $houseId)) === false) {
         if ($bll->errorCode == bll_choice_EsfAPPAPIChoice::CHOICE_CLOSE_ERROR) {
             $data = array('totalClicks' => 0, 'balance' => 0, 'balanceUnit' => '元', 'todayClicks' => 0, 'todayConsume' => 0, 'todayConsumeUnit' => '元', 'clickPrice' => 0, 'clickPriceUnit' => '元', 'maxBucketNum' => 0, 'usedBucketNum' => 0, 'bucketId' => '', 'status' => bll_choice_EsfAPPAPIChoice::PROP_ACTIONTYPE_CHOICE_NOTFIT, 'statusMsg' => '你所在城市未开通精选业务', 'remindStatus' => -1, 'remindStatusMsg' => '不符合精选订阅条件', 'minChoicePrice' => Bll_Plan_Bid_Choice::ESF_CHOICE_MIN_BUDGET, 'minChoicePriceUnit' => '元', 'maxChoicePrice' => Bll_Plan_Bid_Choice::ESF_CHOICE_MAX_BUDGET, 'maxChoicePriceUnit' => '元', 'isDisplaySummary' => $isDisplaySummary);
         } else {
             return array('status' => Const_APIStatus::RETURN_CODE_ERROR, 'errcode' => $bll->errorCode, 'message' => $bll->errorMsg);
         }
     }
     // 是否显示精选概况, 未开通精选城市 0; 分离城市||(未分离城市&&已套餐推广)1; 未分离城市&&未套餐推广 2;
     $cityIsChoice = Model_City_BizType::getCitySiteBizType($cityId, 1, 'choice');
     if (!$cityIsChoice['status']) {
         $isDisplaySummary = 0;
         //未开通精选城市
     } else {
         $isDisplaySummary = 1;
     }
     $data['isDisplaySummary'] = $isDisplaySummary;
     return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => $data);
     demon:
     return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('totalClicks' => 10, 'balance' => 10, 'balanceUnit' => '元', 'todayClicks' => 1, 'todayConsume' => 12, 'todayConsumeUnit' => '元', 'clickPrice' => 1.3, 'clickPriceUnit' => '元', 'maxBucketNum' => 12, 'usedBucketNum' => 6, 'status' => 1 - 2, 'statusMsg' => '排在第3位,马上就能推广啦!', 'minChoicePrice' => Bll_Plan_Bid_Choice::ESF_CHOICE_MIN_BUDGET, 'minChoicePriceUnit' => '元', 'maxChoicePrice' => Bll_Plan_Bid_Choice::ESF_CHOICE_MAX_BUDGET, 'maxChoicePriceUnit' => '元', 'isDisplaySummary' => 1));
 }