- Timestamp:
- 2011/02/11 18:57:37 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_5-dev/data/class/helper/SC_Helper_DB.php
r20116 r20144 455 455 return array($point, $rollback_point); 456 456 } 457 457 458 458 459 459 … … 869 869 /** 870 870 * カテゴリ数の登録を行う. 871 * 871 * 872 872 * 873 873 * @param SC_Query $objQuery SC_Query インスタンス … … 877 877 function sfCountCategory($objQuery = NULL, $is_force_all_count = false){ 878 878 $objProduct = new SC_Product(); 879 879 880 880 if($objQuery == NULL) { 881 881 $objQuery =& SC_Query::getSingletonInstance(); 882 882 } 883 883 884 884 $is_out_trans = false; 885 885 if(!$objQuery->inTransaction()){ … … 887 887 $is_out_trans = true; 888 888 } 889 889 890 890 //共通のfrom/where文の構築 891 891 $sql_where = 'alldtl.del_flg = 0 AND alldtl.status = 1'; … … 897 897 $from = " dtb_products as alldtl "; 898 898 } 899 899 900 900 //dtb_category_countの構成 901 901 // 各カテゴリに所属する商品の数を集計。集計対象には子カテゴリを含まない。 902 902 // 2.5で消える予定だったが復活させます。DELETE処理は無くしました。 903 903 904 904 //まずテーブル内容の元を取得 905 905 if(!$is_force_all_count) { … … 922 922 923 923 $arrCategoryCountNew = $objQuery->getAll($sql); 924 // 各カテゴリに所属する商品の数を集計。集計対象には子カテゴリを「含む」。 924 // 各カテゴリに所属する商品の数を集計。集計対象には子カテゴリを「含む」。 925 925 //差分を取得して、更新対象カテゴリだけを確認する。 926 926 927 //各カテゴリ毎のデータ値において以前との差を見る 927 //各カテゴリ毎のデータ値において以前との差を見る 928 928 //古いデータの構造入れ替え 929 929 $arrOld = array(); … … 950 950 } 951 951 } 952 952 953 953 //対象IDが無ければ終了 954 954 if(count($arrDiffCategory_id) == 0){ … … 961 961 //差分対象カテゴリIDの重複を除去 962 962 $arrDiffCategory_id = array_unique($arrDiffCategory_id); 963 963 964 964 //dtb_category_countの更新 差分のあったカテゴリだけ更新する。 965 965 foreach($arrDiffCategory_id as $cid) { … … 977 977 } 978 978 } 979 979 980 980 //差分があったIDとその親カテゴリIDのリストを取得する 981 981 $arrTgtCategory_id = array(); … … 987 987 } 988 988 } 989 989 990 990 //重複を取り除く 991 991 $arrTgtCategory_id = array_unique($arrTgtCategory_id); … … 2077 2077 $this->sfRegistTempOrder($uniqid, $sqlval); 2078 2078 } 2079 2080 2081 /** 2082 * 配送情報の取得. 2083 * TODO リファクタリング 2084 */ 2085 function sfGetShippingData($orderId) { 2086 $objQuery =& SC_Query::getSingletonInstance(); 2087 $objProduct = new SC_Product(); 2088 $objQuery->setOrder('shipping_id'); 2089 $arrRet = $objQuery->select("*", "dtb_shipping", "order_id = ?", array($orderId)); 2090 2091 foreach (array_keys($arrRet) as $key) { 2092 $objQuery->setOrder('shipping_id'); 2093 $arrItems = $objQuery->select("*", "dtb_shipment_item", "order_id = ? AND shipping_id = ?", 2094 array($orderId, $arrRet[$key]['shipping_id'])); 2095 foreach ($arrItems as $itemKey => $arrDetail) { 2096 foreach ($arrDetail as $detailKey => $detailVal) { 2097 $arrRet[$key]['shipment_item'][$arrDetail['product_class_id']][$detailKey] = $detailVal; 2098 } 2099 2100 $arrRet[$key]['shipment_item'][$arrDetail['product_class_id']]['productsClass'] =& $objProduct->getDetailAndProductsClass($arrDetail['product_class_id']); 2101 } 2102 } 2103 return $arrRet; 2104 } 2105 2079 2106 } 2080 2107 ?>
Note: See TracChangeset
for help on using the changeset viewer.
