Ejemplo n.º 1
0
 function run()
 {
     //获取楼盘详情信息
     $tLoupanDetailData = $this->_getLoupanDetail($this->mId);
     $this->mName = $tLoupanDetailData['name'];
     //楼盘动态列表
     $tLouPanNew = array('loupan' => array('url' => $this->mApiUrl . "HouseApi.php?action=getNewsList&houseId={$this->mId}&pNumber={$this->mPage}&pSize={$this->mPagesize}"));
     $this->_addApi($tLouPanNew, 'loupanNew');
     $this->common();
     $this->assign('loupanData', $this->mApi['loupanNew']['api']['loupan']['result']['data']);
     //分页
     $tPageLink = Util_Route::getNews($this->mId) . '&page=';
     $tTotal = 100;
     //ToDo: 获取数据总数
     $tPageObj = new Util_Page($this->mPagesize, $tTotal, $this->mPage, $this->mPageDisplay, $tPageLink);
     $tPage = $tTotal > $this->mPagesize ? $tPageObj->subPageCss() : '';
     $this->assign('page', $tPage);
     /**
      * 页面公共信息
      */
     $this->assign('mId', $this->mId);
     //楼盘ID
     $this->assign('name', $this->mName);
     //楼盘名称
     $this->assign('loupanDetail', $tLoupanDetailData);
     //楼盘详情信息
     $this->assign('navType', $this->mNavType);
     //导航信息
     $title = $this->mPage > 1 ? "{$this->mName}资讯_{$this->mName}最新动态-{$this->mCompanyName}房产信息网_第{$this->mPage}页" : "{$this->mName}资讯_{$this->mName}最新动态-{$this->mCompanyName}房产信息网";
     $keyword = "{$this->mName}资讯,{$this->mName}最新动态";
     $description = "{$this->mName}小区为您提供{$this->mName}资讯,{$this->mName}最新动态,为您买房、装修、家居家饰提供参考!";
     $this->assign('title', $title);
     $this->assign('keyword', $keyword);
     $this->assign('description', $description);
     $this->display('news.html');
 }
Ejemplo n.º 2
0
 /**
  * 获取列表
  *
  * @param array $aParam            
  * @param string $sOrder            
  * @return array
  */
 public static function getList($aWhere, $iPage, $sOrder = '', $iPageSize = 20, $sUrl = '', $aArg = array(), $bReturnPager = true)
 {
     $iPage = max($iPage, 1);
     $aRet = array();
     $aParam = array('where' => $aWhere, 'limit' => ($iPage - 1) * $iPageSize . ',' . $iPageSize, 'order' => $sOrder);
     $aRet['aList'] = self::getOrm()->fetchAll($aParam);
     if ($iPage == 1 && count($aRet['aList']) < $iPageSize) {
         $aRet['iTotal'] = count($aRet['aList']);
         if ($bReturnPager) {
             $aRet['aPager'] = null;
         }
     } else {
         unset($aParam['limit'], $aParam['order']);
         $aRet['iTotal'] = self::getOrm()->fetchCnt($aParam);
         if ($bReturnPager) {
             if (empty($sUrl)) {
                 $sUrl = Util_Common::getUrl();
             }
             if (empty($aArg)) {
                 $aArg = $_REQUEST;
             }
             $aRet['aPager'] = Util_Page::getPage($aRet['iTotal'], $iPage, $iPageSize, $sUrl, $aArg);
         }
     }
     return $aRet;
 }
Ejemplo n.º 3
0
 public static function getPageList($aParam, $iPage, $sOrder = 'iUpdateTime DESC', $iPageSize = 20, $sUrl = '', $aArg = array())
 {
     $iPage = max($iPage, 1);
     $sSQL = 'SELECT * FROM ' . self::TABLE_NAME . ' WHERE iStatus=' . self::STATUS_VALID;
     $sCntSQL = 'SELECT COUNT(*) as total FROM ' . self::TABLE_NAME . ' WHERE iStatus=' . self::STATUS_VALID;
     if (isset($aParam['iID']) && !empty($aParam['iID'])) {
         $sSQL .= ' AND iID=' . $aParam['iID'];
         $sCntSQL .= ' AND iID=' . $aParam['iID'];
     }
     if (isset($aParam['iCatoryID']) && !empty($aParam['iCatoryID'])) {
         $sSQL .= ' AND iCatoryID=' . $aParam['iCatoryID'];
         $sCntSQL .= ' AND iCatoryID=' . $aParam['iCatoryID'];
     }
     if (isset($aParam['iIsHot']) && !empty($aParam['iIsHot'])) {
         $sSQL .= ' AND iIsHot=' . $aParam['iIsHot'];
         $sCntSQL .= ' AND iIsHot=' . $aParam['iIsHot'];
     }
     if (isset($aParam['iIsRecommend']) && !empty($aParam['iIsRecommend'])) {
         $sSQL .= ' AND iIsRecommend=' . $aParam['iIsRecommend'];
         $sCntSQL .= ' AND iIsRecommend=' . $aParam['iIsRecommend'];
     }
     if (isset($aParam['iUnlockType']) && !empty($aParam['iUnlockType'])) {
         $sSQL .= ' AND iUnlockType=' . $aParam['iUnlockType'];
         $sCntSQL .= ' AND iUnlockType=' . $aParam['iUnlockType'];
     }
     if (isset($aParam['iUnlockLevel']) && !empty($aParam['iUnlockLevel'])) {
         $sSQL .= ' AND iUnlockLevel=' . $aParam['iUnlockLevel'];
         $sCntSQL .= ' AND iUnlockLevel=' . $aParam['iUnlockLevel'];
     }
     if (isset($aParam['sName']) && !empty($aParam['sName'])) {
         $sSQL .= ' AND sName LIKE \'%' . addslashes($aParam['sName']) . '%\'';
         $sCntSQL .= ' AND sName LIKE \'%' . addslashes($aParam['sName']) . '%\'';
     }
     if (isset($aParam['sDesc']) && !empty($aParam['sDesc'])) {
         $sSQL .= ' AND sDesc LIKE \'%' . addslashes($aParam['sDesc']) . '%\'';
         $sCntSQL .= ' AND sDesc LIKE \'%' . addslashes($aParam['sDesc']) . '%\'';
     }
     if (isset($aParam['iCostsStart']) && !empty($aParam['iCostsStart'])) {
         $sSQL .= ' AND iCosts >=' . strtotime($aParam['iCostsStart']);
         $sCntSQL .= ' AND iCosts >=' . strtotime($aParam['iCostsStart']);
     }
     if (isset($aParam['iCostsEnd']) && !empty($aParam['iCostsEnd'])) {
         $sSQL .= ' AND iCosts <=' . strtotime($aParam['iCostsEnd']);
         $sCntSQL .= ' AND iCosts <=' . strtotime($aParam['iCostsEnd']);
     }
     if (isset($aParam['iPriceStart']) && !empty($aParam['iPriceStart'])) {
         $sSQL .= ' AND iPrice >=' . strtotime($aParam['iPriceStart']);
         $sCntSQL .= ' AND iPrice >=' . strtotime($aParam['iPriceStart']);
     }
     if (isset($aParam['iPriceEnd']) && !empty($aParam['iPriceEnd'])) {
         $sSQL .= ' AND iPrice <=' . strtotime($aParam['iPriceEnd']);
         $sCntSQL .= ' AND iPrice <=' . strtotime($aParam['iPriceEnd']);
     }
     if (isset($aParam['iAgentRateStart']) && !empty($aParam['iAgentRateStart'])) {
         $sSQL .= ' AND iAgentRate >=' . strtotime($aParam['iAgentRateStart']);
         $sCntSQL .= ' AND iAgentRate >=' . strtotime($aParam['iAgentRateStart']);
     }
     if (isset($aParam['iAgentRateEnd']) && !empty($aParam['iAgentRateEnd'])) {
         $sSQL .= ' AND iAgentRate <=' . strtotime($aParam['iAgentRateEnd']);
         $sCntSQL .= ' AND iAgentRate <=' . strtotime($aParam['iAgentRateEnd']);
     }
     if (isset($aParam['iUnlockPointStart']) && !empty($aParam['iUnlockPointStart'])) {
         $sSQL .= ' AND iUnlockPoint >=' . strtotime($aParam['iUnlockPointStart']);
         $sCntSQL .= ' AND iUnlockPoint >=' . strtotime($aParam['iUnlockPointStart']);
     }
     if (isset($aParam['iUnlockPointEnd']) && !empty($aParam['iUnlockPointEnd'])) {
         $sSQL .= ' AND iUnlockPoint <=' . strtotime($aParam['iUnlockPointEnd']);
         $sCntSQL .= ' AND iUnlockPoint <=' . strtotime($aParam['iUnlockPointEnd']);
     }
     if (!empty($aParam['iCreateStartTime'])) {
         $sSQL .= ' AND iCreateTime >=' . strtotime($aParam['iCreateStartTime']);
         $sCntSQL .= ' AND iCreateTime >=' . strtotime($aParam['iCreateStartTime']);
     }
     if (!empty($aParam['iCreateEndTime'])) {
         $sSQL .= ' AND iCreateTime <=' . strtotime($aParam['iCreateEndTime']);
         $sCntSQL .= ' AND iCreateTime <=' . strtotime($aParam['iCreateEndTime']);
     }
     $sSQL .= ' Order by ' . $sOrder;
     $sSQL .= ' Limit ' . ($iPage - 1) * $iPageSize . ',' . $iPageSize;
     $aRet['aList'] = self::getOrm()->query($sSQL);
     if ($iPage == 1 && count($aRet['aList']) < $iPageSize) {
         $aRet['iTotal'] = count($aRet['aList']);
         $aRet['aPager'] = null;
     } else {
         unset($aParam['limit'], $aParam['order']);
         $ret = self::getOrm()->query($sCntSQL);
         $aRet['iTotal'] = $ret[0]['total'];
         $aRet['aPager'] = Util_Page::getPage($aRet['iTotal'], $iPage, $iPageSize, '', self::_getNewsPageParam($aParam));
         // update by cjj 2015-02-13 分页增加query 参数
     }
     return $aRet;
 }
Ejemplo n.º 4
0
 /**
  * 搜索自媒体
  * 
  * @param unknown $aParam            
  * @param string $sOrder            
  * @param number $iPageSize            
  * @return Ambigous <NULL, boolean, string, multitype:multitype: Ambigous <> , multitype:, array/string, int/false, number, unknown, unknown>
  */
 public static function search($aParam, $sOrder = '', $iPageSize = 20)
 {
     $aRule = array();
     $aTable = array('t_media m');
     $aWhere = array('m.iStatus=1', 'm.iPut=1', 'm.iMediaType=' . intval($aParam['type']));
     if (!empty($aParam['name'])) {
         $aWhere[] = '(m.sMediaName LIKE "%' . $aParam['name'] . '%" OR m.sOpenName LIKE "%' . $aParam['name'] . '%")';
     }
     if (!empty($aParam['catid'])) {
         $aTable[] = 't_media_category c';
         $aWhere[] = 'c.iMediaID=m.iMediaID';
         $aWhere[] = 'c.iCategoryID=' . intval($aParam['catid']);
         //$aWhere[] = 'c.iCategoryID IN(' . join(',', $aParam['catid']) . ')';
     }
     if (!empty($aParam['price'])) {
         $aPrice = Model_Price::parsePrice($aParam['price']);
         $aWhere[] = '(m.iPrice1>=' . $aPrice[0] . ' AND m.iPrice1<' . $aPrice[1] . ' OR m.iPrice2>=' . $aPrice[0] . ' AND m.iPrice2<' . $aPrice[1] . ')';
     }
     if (!empty($aParam['follower'])) {
         $aFollower = explode('~', $aParam['follower']);
         $aWhere[] = '(m.iFollowerNum>=' . $aFollower[0] . ' AND m.iFollowerNum<' . $aFollower[1] . ')';
     }
     if (!empty($aParam['city'])) {
         $aTable[] = 't_media_city ct';
         $aWhere[] = 'ct.iMediaID=m.iMediaID';
         $aWhere[] = 'ct.iCityID IN(' . join(',', $aParam['city']) . ')';
     }
     if (!empty($aParam['readnum0'])) {
         $aWhere[] = 'm.iReadAvgNum >=' . intval($aParam['readnum0']);
     }
     if (!empty($aParam['readnum1'])) {
         $aWhere[] = 'm.iReadAvgNum <=' . intval($aParam['readnum1']);
     }
     if (!empty($aParam['score'])) {
         $aWhere[] = 'm.iScore >=' . intval($aParam['score']);
     }
     if (!empty($aParam['tag'])) {
         $aTable[] = 't_media_tag t';
         $aWhere[] = 't.iMediaID=m.iMediaID';
         $aWhere[] = 't.iTagID IN(' . join(',', $aParam['tag']) . ')';
     }
     /*
     if (! empty($aParam['aCriceID'])) {
         $aTable[] = 't_media_cricle cr';
         $aWhere[] = 'cr.iMediaID=m.iMediaID';
         $aWhere[] = 'cr.iCricleID IN(' . join(',', $aParam['aCriceID']) . ')';
     }
     */
     $iPage = max(intval($aParam['page']), 1);
     $sLimit = ' LIMIT ' . ($iPage - 1) * $iPageSize . ',' . $iPageSize;
     $sOrder = empty($sOrder) ? '' : ' ORDER BY ' . $sOrder;
     $sSQL = 'SELECT m.* FROM ' . join(',', $aTable) . ' WHERE ' . join(' AND ', $aWhere) . ' GROUP BY m.iMediaID' . $sOrder . $sLimit;
     $aRet['aList'] = self::query($sSQL);
     if ($iPage == 1 && count($aRet['aList']) < $iPageSize) {
         $aRet['iTotal'] = count($aRet['aList']);
         $aRet['aPager'] = null;
     } else {
         unset($aParam['limit'], $aParam['order']);
         $sSQL = 'SELECT COUNT(DISTINCT m.iMediaID) FROM ' . join(',', $aTable) . ' WHERE ' . join(' AND ', $aWhere);
         $aRet['iTotal'] = self::query($sSQL, 'one');
         $sUrl = Util_Common::getUrl();
         $aRet['aPager'] = Util_Page::getPage($aRet['iTotal'], $iPage, $iPageSize, $sUrl, $aParam);
     }
     return $aRet;
 }