Changeset 20412


Ignore:
Timestamp:
2011/02/25 22:31:31 (12 years ago)
Author:
shutta
Message:

refs #1038
r20391 への修正。
並び順の処理を直せていなかった。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_5-dev/data/class/pages/admin/contents/LC_Page_Admin_Contents_RecommendSearch.php

    r20392 r20412  
    8282                $objProduct = new SC_Product(); 
    8383 
    84                 $where = 'del_flg = 0'; 
    85                 $order = "update_date DESC, product_id DESC"; 
    86  
    8784                $wheres = $this->createWhere($objFormParam,$objDb); 
    8885                $this->tpl_linemax = $this->getLineCount($wheres,$objProduct); 
     
    9693 
    9794                $arrProduct_id = $this->getProducts($wheres, $objProduct, $page_max, $startno); 
    98                 $productList = $this->getProductList($arrProduct_id,$objProduct); 
    99                 //取得している並び順で並び替え 
    100                 $this->arrProducts = $this->sortProducts($arrProduct_id,$productList); 
     95                $this->arrProducts = $this->getProductList($arrProduct_id,$objProduct); 
    10196            } 
    10297            break; 
     
    211206        // 取得範囲の指定(開始行番号、行数のセット) 
    212207        $objQuery->setLimitOffset($page_max, $startno); 
    213         // 表示順序 
    214         $objQuery->setOrder($order); 
    215208 
    216209        // 検索結果の取得 
     
    234227        $objQuery =& SC_Query::getSingletonInstance(); 
    235228        $objQuery->setWhere($where); 
     229        // 表示順序 
     230        $order = "update_date DESC, product_id DESC"; 
     231        $objQuery->setOrder($order); 
    236232        return $objProduct->lists($objQuery, $arrProduct_id); 
    237     } 
    238  
    239     /** 
    240      * 取得している並び順で並び替え 
    241      * @param $arrProduct_id 
    242      * @param $productList 
    243      */ 
    244     function sortProducts($arrProduct_id,$productList){ 
    245         $products  = array(); 
    246         foreach($productList as $item) { 
    247             $products[ $item['product_id'] ] = $item; 
    248         } 
    249         $arrProducts = array(); 
    250         foreach($arrProduct_id as $product_id) { 
    251             $arrProducts[] = $products[$product_id]; 
    252         } 
    253         return $arrProducts; 
    254233    } 
    255234} 
Note: See TracChangeset for help on using the changeset viewer.