Ignore:
Timestamp:
2013/02/06 20:32:57 (11 years ago)
Author:
Seasoft
Message:

#2044 (無駄な処理を改善する for 2.12.4)

  • SC_Query::select -> SC_Query::getCol
  • 同一文字列定数値の重複記述を回避

#2043 (typo修正・ソース整形・ソースコメントの改善 for 2.12.4)

Location:
branches/version-2_12-dev/data/class
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-dev/data/class/SC_Product.php

    r22486 r22507  
    7474     */ 
    7575    function findProductIdsOrder(&$objQuery, $arrVal = array()) { 
    76         $table = <<< __EOS__ 
    77             dtb_products AS alldtl 
    78 __EOS__; 
     76        $table = 'dtb_products AS alldtl'; 
     77 
    7978        $objQuery->setGroupBy('alldtl.product_id'); 
    8079        if (is_array($this->arrOrderData) and $objQuery->order == '') { 
     
    9493            $objQuery->setOrder($order); 
    9594        } 
    96         $results = $objQuery->select('alldtl.product_id', $table, '', $arrVal, MDB2_FETCHMODE_ORDERED); 
    97         $resultValues = array(); 
    98         foreach ($results as $val) { 
    99             $resultValues[] = $val[0]; 
    100         } 
    101         return $resultValues; 
     95        $arrReturn = $objQuery->getCol('alldtl.product_id', $table, '', $arrVal); 
     96 
     97        return $arrReturn; 
    10298    } 
    10399 
     
    112108     */ 
    113109    function findProductCount(&$objQuery, $arrVal = array()) { 
    114         $table = <<< __EOS__ 
    115             dtb_products AS alldtl 
    116 __EOS__; 
     110        $table = 'dtb_products AS alldtl'; 
     111 
    117112        return $objQuery->count($table, '', $arrVal); 
    118113    } 
     
    154149__EOS__; 
    155150        $res = $objQuery->select($col, $this->alldtlSQL()); 
     151 
    156152        return $res; 
    157153    } 
     
    232228        $result = $this->getProductsClass($productClassId); 
    233229        $result = array_merge($result, $this->getDetail($result['product_id'])); 
     230 
    234231        return $result; 
    235232    } 
     
    404401        $objQuery->setWhere('product_class_id = ? AND T1.del_flg = 0'); 
    405402        $arrRes = $this->getProductsClassByQuery($objQuery, $productClassId); 
     403 
    406404        return (array)$arrRes[0]; 
    407405    } 
     
    424422        } 
    425423        $objQuery->setWhere($where); 
     424 
    426425        return $this->getProductsClassByQuery($objQuery, $productIds); 
    427426    } 
     
    436435    function getProductsClassFullByProductId($productId, $has_deleted = false) { 
    437436        $arrRet = $this->getProductsClassByProductIds(array($productId), $has_deleted); 
     437 
    438438        return $arrRet; 
    439439    } 
     
    458458            $results[$status['product_id']][] = $status['product_status_id']; 
    459459        } 
     460 
    460461        return $results; 
    461462    } 
     
    504505            $limit = $p['stock']; 
    505506        } 
     507 
    506508        return $limit; 
    507509    } 
     
    701703            ) AS alldtl 
    702704__EOS__; 
     705 
    703706        return $sql; 
    704707    } 
     
    750753        ) as prdcls 
    751754__EOS__; 
     755 
    752756        return $sql; 
    753757    } 
  • branches/version-2_12-dev/data/class/pages/products/LC_Page_Products_List.php

    r22486 r22507  
    375375        } 
    376376 
    377         $searchCondition['where_for_count'] = $searchCondition['where']; 
    378  
    379377        // 在庫無し商品の非表示 
    380378        if (NOSTOCK_HIDDEN) { 
    381379            $searchCondition['where'] .= ' AND EXISTS(SELECT * FROM dtb_products_class WHERE product_id = alldtl.product_id AND del_flg = 0 AND (stock >= 1 OR stock_unlimited = 1))'; 
    382             $searchCondition['where_for_count'] .= ' AND EXISTS(SELECT * FROM dtb_products_class WHERE product_id = alldtl.product_id AND del_flg = 0 AND (stock >= 1 OR stock_unlimited = 1))'; 
    383         } 
     380        } 
     381 
     382        // XXX 一時期内容が異なっていたことがあるので別要素にも格納している。 
     383        $searchCondition['where_for_count'] = $searchCondition['where']; 
    384384 
    385385        return $searchCondition; 
Note: See TracChangeset for help on using the changeset viewer.