Changeset 22486 for branches


Ignore:
Timestamp:
2013/01/30 21:12:01 (11 years ago)
Author:
Seasoft
Message:

#2043 (typo修正・ソース整形・ソースコメントの改善 for 2.12.4)
#2044 (無駄な処理を改善する for 2.12.4)

  • 不必要なインスタンス化
  • 不必要な値渡し
Location:
branches/version-2_12-dev/data
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-dev/data/Smarty/templates/sphone/mypage/favorite.tpl

    r22206 r22486  
    159159                        //販売価格が範囲か判定 
    160160                        if (product.price02_min == product.price02_max) { 
    161                             priceVale = "<!--{$smarty.const.SALE_PRICE_TITLE}-->:" + product.price02_min_tax_format + '円'; 
     161                            priceVale = "<!--{$smarty.const.SALE_PRICE_TITLE}-->:" + product.price02_min_inctax_format + '円'; 
    162162                        } else { 
    163                             priceVale = "<!--{$smarty.const.SALE_PRICE_TITLE}-->:" + product.price02_min_tax_format + '~' + product.price02_max_tax_format + '円'; 
     163                            priceVale = "<!--{$smarty.const.SALE_PRICE_TITLE}-->:" + product.price02_min_inctax_format + '~' + product.price02_max_inctax_format + '円'; 
    164164                        } 
    165165                        price.append(priceVale); 
  • branches/version-2_12-dev/data/Smarty/templates/sphone/products/list.tpl

    r22206 r22486  
    207207                    //販売価格が範囲か判定 
    208208                    if (product.price02_min == product.price02_max) { 
    209                         priceVale = product.price02_min_tax_format + '円'; 
     209                        priceVale = product.price02_min_inctax_format + '円'; 
    210210                    } else { 
    211                         priceVale = product.price02_min_tax_format + '~' + product.price02_max_tax_format + '円'; 
     211                        priceVale = product.price02_min_inctax_format + '~' + product.price02_max_inctax_format + '円'; 
    212212                    } 
    213213                    price.append(priceVale); 
  • branches/version-2_12-dev/data/class/SC_Product.php

    r22484 r22486  
    545545     * 
    546546     * @param array $arrProducts 商品情報の配列 
    547      * @return array 税込金額を設定した商品情報の配列 
    548      */ 
    549     function setPriceTaxTo($arrProducts) { 
    550         foreach ($arrProducts as $key => $value) { 
    551             $arrProducts[$key]['price01_min_format'] = number_format($arrProducts[$key]['price01_min']); 
    552             $arrProducts[$key]['price01_max_format'] = number_format($arrProducts[$key]['price01_max']); 
    553             $arrProducts[$key]['price02_min_format'] = number_format($arrProducts[$key]['price02_min']); 
    554             $arrProducts[$key]['price02_max_format'] = number_format($arrProducts[$key]['price02_max']); 
    555  
    556             $arrProducts[$key]['price01_min_tax'] = SC_Helper_DB_Ex::sfCalcIncTax($arrProducts[$key]['price01_min']); 
    557             $arrProducts[$key]['price01_max_tax'] = SC_Helper_DB_Ex::sfCalcIncTax($arrProducts[$key]['price01_max']); 
    558             $arrProducts[$key]['price02_min_tax'] = SC_Helper_DB_Ex::sfCalcIncTax($arrProducts[$key]['price02_min']); 
    559             $arrProducts[$key]['price02_max_tax'] = SC_Helper_DB_Ex::sfCalcIncTax($arrProducts[$key]['price02_max']); 
    560  
    561             $arrProducts[$key]['price01_min_tax_format'] = number_format($arrProducts[$key]['price01_min_tax']); 
    562             $arrProducts[$key]['price01_max_tax_format'] = number_format($arrProducts[$key]['price01_max_tax']); 
    563             $arrProducts[$key]['price02_min_tax_format'] = number_format($arrProducts[$key]['price02_min_tax']); 
    564             $arrProducts[$key]['price02_max_tax_format'] = number_format($arrProducts[$key]['price02_max_tax']); 
    565         } 
     547     * @return array 旧バージョン互換用のデータ 
     548     */ 
     549    static function setPriceTaxTo(&$arrProducts) { 
     550        foreach ($arrProducts as &$arrProduct) { 
     551            $arrProduct['price01_min_format'] = number_format($arrProduct['price01_min']); 
     552            $arrProduct['price01_max_format'] = number_format($arrProduct['price01_max']); 
     553            $arrProduct['price02_min_format'] = number_format($arrProduct['price02_min']); 
     554            $arrProduct['price02_max_format'] = number_format($arrProduct['price02_max']); 
     555 
     556            SC_Product_Ex::setIncTaxToProduct($arrProduct); 
     557 
     558            $arrProduct['price01_min_inctax_format'] = number_format($arrProduct['price01_min_inctax']); 
     559            $arrProduct['price01_max_inctax_format'] = number_format($arrProduct['price01_max_inctax']); 
     560            $arrProduct['price02_min_inctax_format'] = number_format($arrProduct['price02_min_inctax']); 
     561            $arrProduct['price02_max_inctax_format'] = number_format($arrProduct['price02_max_inctax']); 
     562 
     563            // @deprecated 2.12.4 
     564            // 旧バージョン互換用 
     565            // 本来は、税額の代入で使用すべきキー名。 
     566            $arrProduct['price01_min_tax_format'] =& $arrProduct['price01_min_inctax_format']; 
     567            $arrProduct['price01_max_tax_format'] =& $arrProduct['price01_max_inctax_format']; 
     568            $arrProduct['price02_min_tax_format'] =& $arrProduct['price02_min_inctax_format']; 
     569            $arrProduct['price02_max_tax_format'] =& $arrProduct['price02_max_inctax_format']; 
     570        } 
     571        // @deprecated 2.12.4 
     572        // 旧バージョン互換用 
     573        // 現在は参照渡しで戻せる 
    566574        return $arrProducts; 
    567575    } 
  • branches/version-2_12-dev/data/class/api/operations/ItemSearch.php

    r22206 r22486  
    6868            if (!SC_Utils_Ex::isBlank($arrProducts)) { 
    6969                $arrProducts = $this->setStatusDataTo($arrProducts, $arrSTATUS, $arrSTATUS_IMAGE); 
    70                 $arrProducts = $objProduct->setPriceTaxTo($arrProducts); 
     70                SC_Product_Ex::setPriceTaxTo($arrProducts); 
    7171                foreach ($arrProducts as $key=>$val) { 
    7272                    $arrProducts[$key]['main_list_image'] = SC_Utils_Ex::sfNoImageMainList($val['main_list_image']); 
  • branches/version-2_12-dev/data/class/pages/mypage/LC_Page_Mypage_Favorite.php

    r22232 r22486  
    6868     */ 
    6969    function action() { 
     70        $objCustomer = new SC_Customer_Ex(); 
    7071 
    71         $objProduct  = new SC_Product_Ex(); 
    72         $objCustomer = new SC_Customer_Ex(); 
    7372        $customer_id = $objCustomer->getValue('customer_id'); 
    7473 
     
    7877                $this->lfDeleteFavoriteProduct($customer_id, intval($_POST['product_id'])); 
    7978                break; 
     79 
    8080            case 'getList': 
    8181                // スマートフォン版のもっと見るボタン用 
     
    8585                } 
    8686                $this->arrFavorite = $this->lfGetFavoriteProduct($customer_id, $this); 
    87                 $this->arrFavorite = $objProduct->setPriceTaxTo($this->arrFavorite); 
    88  
     87                SC_Product_Ex::setPriceTaxTo($this->arrFavorite); 
    8988 
    9089                echo SC_Utils_Ex::jsonEncode($this->arrFavorite); 
    9190                SC_Response_Ex::actionExit(); 
     91                break; 
     92 
     93            default: 
    9294                break; 
    9395        } 
  • branches/version-2_12-dev/data/class/pages/products/LC_Page_Products_List.php

    r22313 r22486  
    446446    /** 
    447447     * 
    448      * @param type $objProduct  
    449      * @return void 
    450      */ 
    451     function doJson(&$objProduct) { 
     448     * @return void 
     449     */ 
     450    function doJson() { 
    452451        $this->arrProducts = $this->setStatusDataTo($this->arrProducts, $this->arrSTATUS, $this->arrSTATUS_IMAGE); 
    453         $this->arrProducts = $objProduct->setPriceTaxTo($this->arrProducts); 
     452        SC_Product_Ex::setPriceTaxTo($this->arrProducts); 
    454453 
    455454        // 一覧メイン画像の指定が無い商品のための処理 
Note: See TracChangeset for help on using the changeset viewer.