Exemplo n.º 1
0
 /**
  * 金铺-精选房源管理页面
  * 返回值 为页面参数,所以必须是数组
  *
  * @param int $ajkBrokerId
  * @param int $cityId
  * @param array $extraData $request->get_parameters();
  * @return array
  */
 public static function jp_init_manage($ajkBrokerId, $cityId, $extraData = array())
 {
     //$jpBrokerInfo = Model_Broker_JpBroker::getJpBrokerInfoByAjkBrokerId($ajkBrokerId);
     $arrBidSpreadData = Model_Plan_Jp::getBidChoiceInfoEx($cityId, $ajkBrokerId);
     $isSpreadFull = count($arrBidSpreadData) >= self::ALL_JP_PLAN_NUM ? 1 : 0;
     $houseInfoArr = array();
     foreach ($arrBidSpreadData as $spread) {
         $houseId = $spread->houseId;
         //计划Id
         $spreadId = $spread->id;
         //状态
         $status = $spread->status;
         $planOverStatus = $status;
         if ($status == 4 || $status == 3) {
             $status = 14;
         }
         $houseInfoArr[$status][$houseId]['spreadId'] = $spreadId;
         $lChargeSum = Model_Payment_ChargeSum::data_access()->filter('spread_id', $spreadId)->find_only();
         //$clickSum = empty($lChargeSum) ? 0 : $lChargeSum->click_sum;
         $clickSum = Bll_House_JpHouseInfo::get_today_click_info_by_house($houseId);
         $costSum = empty($lChargeSum) ? 0 : $lChargeSum->cost_sum;
         $houseInfoArr[$status][$houseId]['clickSum'] = $clickSum;
         $houseInfoArr[$status][$houseId]['initBudget'] = sprintf('%.2f', $spread->budget / 100);
         $houseInfoArr[$status][$houseId]['budget'] = sprintf('%.2f', ($spread->budget - $costSum) / 100);
         $statusText = Bll_House_JpHouseInfo::formatHouseSpreadStatus($status, $spread);
         $houseInfoArr[$status][$houseId]['status'] = $status;
         $houseInfoArr[$status][$houseId]['planOverStatus'] = $planOverStatus;
         $houseInfoArr[$status][$houseId]['statusText'] = $statusText;
         $houseRelation = Bll_House_JpHouseInfo::getHouseInfoById($houseId);
         $houseType = $houseRelation['houseType'];
         $houseObj = $houseRelation['info'];
         //点击单击
         $houseInfoArr[$status][$houseId]['unit_price'] = sprintf('%.2f', $houseObj->spreadOffer / 100);
         $houseInfoArr[$status][$houseId]['isExquisite'] = $houseObj->isExquisite;
         $houseInfoArr[$status][$houseId]['houseTypeDesShort'] = Bll_House_JpHouseInfo::$arrHouseTypeDes['short'][$houseType];
         $houseInfoArr[$status][$houseId]['title'] = $houseObj->title;
         $houseInfoArr[$status][$houseId]['area'] = $houseObj->area;
         $houseInfoArr[$status][$houseId]['floor_info'] = Bll_House_JpHouseInfo::getHouseFloorInfo(self::convertObjToArray($houseObj), $houseType);
         $houseInfoArr[$status][$houseId]['property_name'] = Bll_House_JpHouseInfo::getHousePropertyName($houseRelation['info'], $houseType);
         $houseInfoArr[$status][$houseId]['url'] = Uri_JPHouse::build_index($cityId, $houseType) . $houseId;
         $houseInfoArr[$status][$houseId]['house_type'] = $houseType;
         $houseInfoArr[$status][$houseId]['price_info'] = Bll_House_JpHouseInfo::getHousePriceInfo(self::convertObjToArray($houseObj), $houseType);
     }
     ksort($houseInfoArr);
     $pageAttributes['isSpreadFull'] = $isSpreadFull;
     $pageAttributes['houseInfo'] = $houseInfoArr;
     return $pageAttributes;
 }