Changeset 18824 for branches/version-2_5-dev/data
- Timestamp:
- 2010/09/27 11:49:29 (16 years ago)
- Location:
- branches/version-2_5-dev/data/class
- Files:
-
- 10 edited
-
SC_Product.php (modified) (1 diff)
-
db/SC_DB_DBFactory.php (modified) (1 diff)
-
db/dbfactory/SC_DB_DBFactory_MYSQL.php (modified) (2 diffs)
-
db/dbfactory/SC_DB_DBFactory_PGSQL.php (modified) (1 diff)
-
pages/mypage/LC_Page_Mypage_DownLoad.php (modified) (4 diffs)
-
pages/mypage/LC_Page_Mypage_History.php (modified) (1 diff)
-
pages/mypage/LC_Page_Mypage_HistoryDetail.php (modified) (1 diff)
-
pages/products/LC_Page_Products_Detail.php (modified) (9 diffs)
-
pages/products/LC_Page_Products_List.php (modified) (2 diffs)
-
pages/shopping/LC_Page_Shopping_Complete.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_5-dev/data/class/SC_Product.php
r18821 r18824 257 257 $levels = array(); 258 258 $parents = array(); 259 $i = 0;260 259 foreach ($arrRet as $rows) { 261 if($rows['level']==""){262 $rows['level']="1";263 $arrRet[$i]['level'] = $rows['level'];264 265 }266 260 $levels[] = $rows['level']; 267 261 $parents[] = $rows['parent_class_combination_id']; -
branches/version-2_5-dev/data/class/db/SC_DB_DBFactory.php
r18820 r18824 125 125 * ダウンロード販売の検索条件の SQL を返す. 126 126 * 127 * @param string $dtb_order_alias128 127 * @return string 検索条件の SQL 129 128 */ 130 function getDownloadableDaysWhereSql( $dtb_order_alias) { return null; }129 function getDownloadableDaysWhereSql() { return null; } 131 130 132 131 /** -
branches/version-2_5-dev/data/class/db/dbfactory/SC_DB_DBFactory_MYSQL.php
r18820 r18824 142 142 * @return string 検索条件の SQL 143 143 */ 144 function getDownloadableDaysWhereSql( $dtb_order_alias) {145 return "(SELECT IF((SELECT d1.downloadable_days_unlimited FROM dtb_baseinfo d1)=1, 1, DATE(NOW()) <= DATE(DATE_ADD( " . $dtb_order_alias . ".commit_date, INTERVAL (SELECT downloadable_days FROM dtb_baseinfo) DAY))))";144 function getDownloadableDaysWhereSql() { 145 return "(SELECT IF((SELECT d1.downloadable_days_unlimited FROM dtb_baseinfo d1)=1, 1, DATE(NOW()) <= DATE(DATE_ADD(o.payment_date, INTERVAL (SELECT downloadable_days FROM dtb_baseinfo) DAY))))"; 146 146 } 147 147 … … 415 415 ) 416 416 __EOS__; 417 418 $sql['vw_download_class'] = <<< __EOS__419 (SELECT420 pc.product_id AS product_id,421 pc.classcategory_id1 AS classcategory_id1,422 pc.classcategory_id2 AS classcategory_id2,423 pc.down_realfilename AS down_realfilename ,424 pc.down_filename AS down_filename,425 o.order_id AS order_id,426 o.customer_id AS customer_id,427 o.payment_date AS payment_date,428 o.status AS status429 FROM430 dtb_products_class pc,431 dtb_order_detail od,432 dtb_order o433 WHERE434 pc.product_id = od.product_id AND435 pc.classcategory_id1 = od.classcategory_id1 AND436 pc.classcategory_id2 = od.classcategory_id2 AND437 od.order_id = o.order_id438 )439 __EOS__;440 441 417 } 442 418 -
branches/version-2_5-dev/data/class/db/dbfactory/SC_DB_DBFactory_PGSQL.php
r18820 r18824 122 122 * @return string 検索条件の SQL 123 123 */ 124 function getDownloadableDaysWhereSql( $dtb_order_alias) {124 function getDownloadableDaysWhereSql() { 125 125 $baseinfo = SC_Helper_DB_Ex::sf_getBasisData(); 126 126 //downloadable_daysにNULLが入っている場合(無期限ダウンロード可能時)もあるので、NULLの場合は0日に補正 127 127 $downloadable_days = $baseinfo['downloadable_days']; 128 128 if($downloadable_days ==null || $downloadable_days == "")$downloadable_days=0; 129 return "(SELECT CASE WHEN (SELECT d1.downloadable_days_unlimited FROM dtb_baseinfo d1) = 1 AND " . $dtb_order_alias . ".payment_date IS NOT NULL THEN 1 WHEN DATE(NOW()) <= DATE(" . $dtb_order_alias . ".payment_date + '". $downloadable_days ." days') THEN 1 ELSE 0 END)";129 return "(SELECT CASE WHEN (SELECT d1.downloadable_days_unlimited FROM dtb_baseinfo d1) = 1 AND o.payment_date IS NOT NULL THEN 1 WHEN DATE(NOW()) <= DATE(o.payment_date + '". $downloadable_days ." days') THEN 1 ELSE 0 END)"; 130 130 } 131 131 -
branches/version-2_5-dev/data/class/pages/mypage/LC_Page_Mypage_DownLoad.php
r18820 r18824 58 58 $order_id = $_GET['order_id']; 59 59 $product_id = $_GET['product_id']; 60 $classcategory_id1 = $_GET['classcategory_id1']; 61 $classcategory_id2 = $_GET['classcategory_id2']; 60 $product_class_id = $_GET['product_class_id']; 62 61 63 62 // ID の数値チェック … … 66 65 || !is_numeric($order_id) 67 66 || !is_numeric($product_id) 68 || !is_numeric($classcategory_id1) 69 || !is_numeric($classcategory_id2)) { 67 || !is_numeric($product_class_id)) { 70 68 SC_Utils_Ex::sfDispSiteError(""); 71 69 } … … 79 77 //DBから商品情報の読込 80 78 81 $arrForm = $this->lfGetRealFileName($customer_id, $order_id, $product_id, $ classcategory_id1, $classcategory_id2);79 $arrForm = $this->lfGetRealFileName($customer_id, $order_id, $product_id, $product_class_id); 82 80 83 81 //ステータスが支払済み以上である事 … … 125 123 * @param integer $order_id 受注ID 126 124 * @param integer $product_id 商品ID 125 * @param integer $product_class_id 商品規格ID 127 126 * @return array 商品情報の配列 128 127 */ 129 function lfGetRealFileName($customer_id, $order_id, $product_id, $ classcategory_id1, $classcategory_id2) {128 function lfGetRealFileName($customer_id, $order_id, $product_id, $product_class_id) { 130 129 $objQuery = new SC_Query(); 131 $col = "*"; 132 $table = "vw_download_class AS T1"; 130 $col = <<< __EOS__ 131 pc.product_id AS product_id, 132 pc.product_class_id AS product_class_id, 133 pc.down_realfilename AS down_realfilename, 134 pc.down_filename AS down_filename, 135 o.order_id AS order_id, 136 o.customer_id AS customer_id, 137 o.payment_date AS payment_date, 138 o.status AS status 139 __EOS__; 140 141 $table = <<< __EOS__ 142 dtb_products_class pc, 143 dtb_order_detail od, 144 dtb_order o 145 __EOS__; 146 133 147 $dbFactory = SC_DB_DBFactory_Ex::getInstance(); 134 $where = " T1.customer_id = ? AND T1.order_id = ? AND T1.product_id = ? AND T1.classcategory_id1 = ? AND T1.classcategory_id2= ?";135 $where .= " AND " . $dbFactory->getDownloadableDaysWhereSql( "T1");148 $where = "o.customer_id = ? AND o.order_id = ? AND pc.product_id = ? AND pc.product_class_id = ?"; 149 $where .= " AND " . $dbFactory->getDownloadableDaysWhereSql(); 136 150 $where .= " = 1"; 137 151 $arrRet = $objQuery->select($col, $table, $where, 138 array($customer_id, $order_id, $product_id, $ classcategory_id1, $classcategory_id2));152 array($customer_id, $order_id, $product_id, $product_class_id)); 139 153 return $arrRet[0]; 140 154 } -
branches/version-2_5-dev/data/class/pages/mypage/LC_Page_Mypage_History.php
r18820 r18824 227 227 $col .= "od.classcategory_name2 AS classcategory_name2, od.price AS price, od.quantity AS quantity, od.point_rate AS point_rate"; 228 228 $col .= ",CASE WHEN EXISTS(SELECT * FROM dtb_products WHERE product_id = od.product_id AND del_flg = 0 AND status = 1) THEN '1' ELSE '0' END AS enable"; 229 $col .= ",o.status AS status, pc.down AS down, o.payment_date AS payment_date, od. classcategory_id1 as classcategory_id1, od.classcategory_id2 as classcategory_id2, ";229 $col .= ",o.status AS status, pc.down AS down, o.payment_date AS payment_date, od.product_class_id as product_class_id, "; 230 230 $col .= $dbFactory->getDownloadableDaysWhereSql("o"); 231 231 $col .= " AS effective"; 232 232 233 $where = "p.product_id = od.product_id AND pc.product_id = od.product_id AND pc. classcategory_id1 = od.classcategory_id1 AND pc.classcategory_id2 = od.classcategory_id2AND od.order_id = o.order_id AND od.order_id = ?";233 $where = "p.product_id = od.product_id AND pc.product_id = od.product_id AND pc.product_class_id = od.product_class_id AND od.order_id = o.order_id AND od.order_id = ?"; 234 234 $arrRet = $objQuery->select($col, "dtb_products p, dtb_products_class pc, dtb_order_detail od, dtb_order o", $where); 235 235 return $arrRet; -
branches/version-2_5-dev/data/class/pages/mypage/LC_Page_Mypage_HistoryDetail.php
r18701 r18824 142 142 $col = "product_id, product_code, product_name, classcategory_name1, classcategory_name2, price, quantity, point_rate"; 143 143 $where = "order_id = ?"; 144 $objQuery->setOrder(" classcategory_id1, classcategory_id2");144 $objQuery->setOrder("product_class_id"); 145 145 $arrRet = $objQuery->select($col, "dtb_order_detail", $where, array($order_id)); 146 146 return $arrRet; -
branches/version-2_5-dev/data/class/pages/products/LC_Page_Products_Detail.php
r18820 r18824 159 159 // 規格2クラス名 160 160 $this->tpl_class_name2 = $objProduct->className2[$product_id]; 161 161 162 162 // 規格1 163 163 $this->arrClassCat1 = $objProduct->classCats1[$product_id]; … … 181 181 if (!isset($_POST['mode'])) $_POST['mode'] = ""; 182 182 $arrErr = array(); 183 183 184 184 switch($_POST['mode']) { 185 185 case 'cart': … … 189 189 if (count($arrErr) == 0) { 190 190 $objCartSess = new SC_CartSession(); 191 $product_class_id = $_POST['product_class_id']; 191 192 $classcategory_id1 = $_POST['classcategory_id1']; 192 193 $classcategory_id2 = $_POST['classcategory_id2']; … … 206 207 } 207 208 208 $objCartSess->addProduct(array($_POST['product_id'], $ classcategory_id1, $classcategory_id2), $this->objFormParam->getValue('quantity'));209 $objCartSess->addProduct(array($_POST['product_id'], $product_class_id, $classcategory_id1, $classcategory_id2), $this->objFormParam->getValue('quantity')); 209 210 210 211 if (!empty($_POST['gmo_oneclick'])) { … … 233 234 // サブタイトルを取得 234 235 $this->tpl_subtitle = $this->arrProduct['name']; 235 236 236 237 // 関連カテゴリを取得 237 238 $this->arrRelativeCat = $objDb->sfGetMultiCatTree($product_id); 238 239 239 240 // 画像ファイル指定がない場合の置換処理 240 241 $this->arrProduct['main_image'] 241 242 = SC_Utils_Ex::sfNoImageMain($this->arrProduct['main_image']); 242 243 243 244 $this->lfSetFile(); 244 245 // 支払方法の取得 … … 296 297 // プロダクトIDの正当性チェック 297 298 $product_id = $this->lfCheckProductId(); 298 299 299 300 $objView = new SC_MobileView(); 300 301 $objCustomer = new SC_Customer(); … … 398 399 if(count($this->arrErr) == 0) { 399 400 $objCartSess = new SC_CartSession(); 401 $product_class_id = $_POST['product_class_id']; 400 402 $classcategory_id1 = $_POST['classcategory_id1']; 401 403 $classcategory_id2 = $_POST['classcategory_id2']; … … 411 413 } 412 414 413 $objCartSess->addProduct(array($_POST['product_id'], $ classcategory_id1, $classcategory_id2), $this->objFormParam->getValue('quantity'));415 $objCartSess->addProduct(array($_POST['product_id'], $product_class_id, $classcategory_id1, $classcategory_id2), $this->objFormParam->getValue('quantity')); 414 416 $this->sendRedirect($this->getLocation(MOBILE_URL_CART_TOP), true); 415 417 exit; … … 427 429 // サブタイトルを取得 428 430 $this->tpl_subtitle = $this->arrProduct["name"]; 429 431 430 432 // 画像ファイル指定がない場合の置換処理 431 433 $this->arrProduct['main_image'] 432 434 = SC_Utils_Ex::sfNoImageMain($this->arrProduct['main_image']); 433 435 434 436 // ファイル情報のセット 435 437 $this->lfSetFile(); -
branches/version-2_5-dev/data/class/pages/products/LC_Page_Products_List.php
r18820 r18824 145 145 $arrErr = $this->lfCheckError($product_id); 146 146 if (count($arrErr) == 0) { 147 $product_class_id = $this->arrForm['product_class_id']; 147 148 $classcategory_id1 = $this->arrForm['classcategory_id1']; 148 149 $classcategory_id2 = $this->arrForm['classcategory_id2']; 149 // 規格1が設定されていない場合150 // 規格1が設定されていない場合 150 151 if (!$this->tpl_classcat_find1[$product_id]) { 151 $classcategory_id1 = '0';152 }153 // 規格2が設定されていない場合152 $classcategory_id1 = '0'; 153 } 154 // 規格2が設定されていない場合 154 155 if (!$this->tpl_classcat_find2[$product_id]) { 155 $classcategory_id2 = '0';156 }156 $classcategory_id2 = '0'; 157 } 157 158 $objCartSess = new SC_CartSession(); 158 $objCartSess->addProduct(array($product_id, $ classcategory_id1, $classcategory_id2), $this->arrForm['quantity']);159 $objCartSess->addProduct(array($product_id, $product_class_id, $classcategory_id1, $classcategory_id2), $this->arrForm['quantity']); 159 160 $this->sendRedirect($this->getLocation(URL_CART_TOP)); 160 161 exit; … … 163 164 $arrProduct =& $this->arrProducts[$key]; 164 165 if ($arrProduct['product_id'] == $product_id) { 166 $arrProduct['product_class_id'] = $this->arrForm['product_class_id']; 165 167 $arrProduct['classcategory_id1'] = $this->arrForm['classcategory_id1']; 166 168 $arrProduct['classcategory_id2'] = $this->arrForm['classcategory_id2']; -
branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping_Complete.php
r18820 r18824 544 544 $sqlval['order_id'] = $order_id; 545 545 $sqlval['product_id'] = $arrCart[$i]['id'][0]; 546 $sqlval['classcategory_id1'] = $arrCart[$i]['id'][1]; 547 $sqlval['classcategory_id2'] = $arrCart[$i]['id'][2]; 546 $sqlval['product_class_id'] = $arrCart[$i]['id'][1]; 547 $sqlval['classcategory_id1'] = $arrCart[$i]['id'][2]; 548 $sqlval['classcategory_id2'] = $arrCart[$i]['id'][3]; 548 549 $sqlval['product_name'] = $arrData['name']; 549 550 $sqlval['product_code'] = $arrData['product_code']; … … 675 676 $objProduct = new SC_Product(); 676 677 $productsClass = $objProduct->getProductsClassFullByProductId($arrID[0]); 677 678 678 679 foreach ($productsClass as $val) { 679 if ($val['classcategory_id1'] == $arrID[ 1]680 && $val['classcategory_id2'] == $arrID[ 2]) {680 if ($val['classcategory_id1'] == $arrID[2] 681 && $val['classcategory_id2'] == $arrID[3]) { 681 682 682 683 if (($val['stock_unlimited'] != '1' && $val['stock'] < $quantity) || $quantity == 0) {
Note: See TracChangeset
for help on using the changeset viewer.
