Ignore:
Timestamp:
2013/02/22 20:22:51 (11 years ago)
Author:
pineray
Message:

#2160 pageクラスからdtb_newsテーブルを直接指定している箇所をなくす
新着情報管理のページクラス内の処理を他と統一する

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-dev/data/class/pages/rss/LC_Page_Rss.php

    r22567 r22581  
    5959    { 
    6060 
    61         $objQuery = SC_Query_Ex::getSingletonInstance(); 
    6261        $objView = new SC_SiteView_Ex(false); 
    6362 
    6463        //新着情報を取得 
    65         $arrNews = $this->lfGetNews($objQuery); 
     64        $arrNews = $this->lfGetNews(); 
    6665 
    6766        //キャッシュしない(念のため) 
     
    101100     * 新着情報を取得する 
    102101     * 
    103      * @param SC_Query $objQuery DB操作クラス 
    104102     * @return array $arrNews 取得結果を配列で返す 
    105103     */ 
    106     function lfGetNews(&$objQuery) 
     104    function lfGetNews() 
    107105    { 
    108         $col = ''; 
    109         $col .= 'news_id ';        // 新着情報ID 
    110         $col .= ',news_title ';    // 新着情報タイトル 
    111         $col .= ',news_comment ';  // 新着情報本文 
    112         $col .= ',news_date ';     // 日付 
    113         $col .= ',news_url ';      // 新着情報URL 
    114         $col .= ',news_select ';   // 新着情報の区分(1:URL、2:本文) 
    115         $col .= ',(SELECT shop_name FROM dtb_baseinfo limit 1) AS shop_name  ';    // 店名 
    116         $col .= ',(SELECT email04 FROM dtb_baseinfo limit 1) AS email ';           // 代表Emailアドレス 
    117         $from = 'dtb_news'; 
    118         $where = "del_flg = '0'"; 
    119         $order = 'rank DESC'; 
    120         $objQuery->setOrder($order); 
    121         $arrNews = $objQuery->select($col,$from,$where); 
     106        $objNews = new SC_Helper_News_Ex(); 
     107        $arrNews = $objNews->getList(); 
     108 
     109        $objDb = new SC_Helper_DB_Ex(); 
     110        $arrInfo = $objDb->sfGetBasisData(FALSE, 'shop_name, email04'); 
    122111 
    123112        // RSS用に変換 
     
    126115 
    127116            $row =& $arrNews[$key]; 
     117            $row['shop_name'] = $arrInfo['shop_name']; 
     118            $row['email'] = $arrInfo['email04']; 
    128119            // 日付 
    129120            $row['news_date'] = date('r', strtotime($row['news_date'])); 
Note: See TracChangeset for help on using the changeset viewer.