Changeset 19688
- Timestamp:
- 2010/11/29 20:59:11 (13 years ago)
- bzr:base-revision:
- svn-v4:1e3b908f-19a9-db11-a64c-001125224ba8:branches/version-2_5-dev:19687
- bzr:committer:
- Kentaro Ohkouchi <ohkouchi@loop-az.jp>
- bzr:file-ids:
data/Smarty/templates/admin/products/product.tpl 15732@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2FSmarty%2Ftemplates%2Fdefault%2Fadmin%2Fproducts%2Fproduct.tpl
data/class/SC_CartSession.php 15078@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2FSC_CartSession.php
data/class/SC_Product.php 18277@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Fcomu-ver2%2Fdata%2Fclass%2FSC_Product.php
data/class/helper/SC_Helper_DB.php 15176@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fhelper%2FSC_Helper_DB.php
data/class/pages/admin/products/LC_Page_Admin_Products_Product.php 15342@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fadmin%2Fproducts%2FLC_Page_Admin_Products_Product.php
data/class/pages/shopping/LC_Page_Shopping_Payment.php 15223@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fshopping%2FLC_Page_Shopping_Payment.php- bzr:mapping-version:
- v4
- bzr:repository-uuid:
- 1e3b908f-19a9-db11-a64c-001125224ba8
- bzr:revision-id:
- ohkouchi@loop-az.jp-20101129115904-lavlfei90639y783
- bzr:revno:
- 2418
- bzr:revprop:branch-nick:
- branches/version-2_5-dev
- bzr:root:
- branches/version-2_5-dev
- bzr:timestamp:
- 2010-11-29 20:59:04.048000097 +0900
- bzr:user-agent:
- bzr2.2.1+bzr-svn1.0.4
- svn:original-date:
- 2010-11-29T11:59:04.048000Z
- Location:
- branches/version-2_5-dev/data
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_5-dev/data/Smarty/templates/admin/products/product.tpl
r19670 r19688 197 197 </tr> 198 198 <tr> 199 <th>支払方法</th> 200 <td> 201 <!--{html_checkboxes name="payment_ids" options=$arrPayments selected=$arrForm.payment_ids}--> 202 </td> 203 </tr> 204 <tr> 199 205 <th>ポイント付与率<span class="attention"> *</span></th> 200 206 <td> -
branches/version-2_5-dev/data/class/SC_CartSession.php
r19680 r19688 349 349 } 350 350 351 /** 352 * カート内にある商品規格IDを全て取得する. 353 * 354 * @param integer $productTypeId 商品種別ID 355 * @return array 商品規格ID の配列 356 */ 357 function getAllProductClassID($productTypeId) { 358 $max = $this->getMax($productTypeId); 359 for($i = 0; $i <= $max; $i++) { 360 if($this->cartSession[$productTypeId][$i]['cart_no'] != "") { 361 $arrRet[] = $this->cartSession[$productTypeId][$i]['id']; 362 } 363 } 364 return $arrRet; 365 } 366 351 367 function delAllProducts($productTypeId) { 352 368 $max = $this->getMax($productTypeId); … … 499 515 // 配送業者の送料を加算 500 516 if (OPTION_DELIV_FEE == 1) { 501 $results['deliv_fee'] += $objDb->sfGetDelivFee( 502 array('deliv_pref' => $deliv_pref, 503 'payment_id' => $payment_id)); 517 $results['deliv_fee'] += $objDb->sfGetDelivFee($deliv_pref, $productTypeId); 504 518 } 505 519 -
branches/version-2_5-dev/data/class/SC_Product.php
r19680 r19688 48 48 /** 検索用並び替え条件配列 */ 49 49 var $arrOrderData; 50 50 51 51 /** 52 52 * 商品検索結果の並び順を指定する。 … … 574 574 // TODO エラーハンドリング 575 575 return true; 576 } 577 578 /** 579 * 引数の商品規格IDで有効な支払方法IDの配列を取得する. 580 * 581 * @param array $productClassIds 商品規格IDの配列 582 * @return array 支払方法IDの配列 583 */ 584 function getEnablePaymentIds($productClassIds) { 585 $size = count($productClassIds); 586 $objQuery =& SC_Query::getSingletonInstance(); 587 $objQuery->groupby = 'GROUP BY payment_id HAVING COUNT(payment_id) = ?'; 588 $paymentIds = $objQuery->getCol('dtb_payment_options', 'payment_id', 589 'product_class_id IN (' . implode(', ', array_pad(array(), $size, '?')) . ')', 590 array_merge($productClassIds, array($size)), 591 MDB2_FETCHMODE_ORDERED); 592 var_dump($productClassIds); 593 return $paymentIds; 576 594 } 577 595 -
branches/version-2_5-dev/data/class/helper/SC_Helper_DB.php
r19680 r19688 1484 1484 1485 1485 /** 1486 * お届け時間を取得する.1487 * 1488 * @param integer $p ayment_id 支払い方法ID1486 * 商品種別からお届け時間を取得する. 1487 * 1488 * @param integer $productTypeId 商品種別ID 1489 1489 * @return array お届け時間の配列 1490 1490 */ 1491 function sfGetDelivTime($p ayment_id = "") {1491 function sfGetDelivTime($productTypeId) { 1492 1492 $objQuery =& SC_Query::getSingletonInstance(); 1493 1493 … … 1496 1496 1497 1497 if($payment_id != "") { 1498 $where = "del_flg = 0 AND p ayment_id = ?";1499 $arrRet = $objQuery->select("deliv_id", "dtb_payment", $where, array($p ayment_id));1498 $where = "del_flg = 0 AND product_type_id = ?"; 1499 $arrRet = $objQuery->select("deliv_id", "dtb_payment", $where, array($productTypeId)); 1500 1500 $deliv_id = $arrRet[0]['deliv_id']; 1501 1501 } … … 1516 1516 * @return string 指定の都道府県, 支払い方法の配送料金 1517 1517 */ 1518 function sfGetDelivFee($arrData) { 1519 $pref = $arrData['deliv_pref']; 1520 $payment_id = isset($arrData['payment_id']) ? $arrData['payment_id'] : ""; 1521 1522 $objQuery =& SC_Query::getSingletonInstance(); 1523 1524 $deliv_id = ""; 1525 1526 // 支払い方法が指定されている場合は、対応した配送業者を取得する 1527 if($payment_id != "") { 1528 $where = "del_flg = 0 AND payment_id = ?"; 1529 $arrRet = $objQuery->select("deliv_id", "dtb_payment", $where, array($payment_id)); 1530 $deliv_id = $arrRet[0]['deliv_id']; 1531 // 支払い方法が指定されていない場合は、先頭の配送業者を取得する 1532 } else { 1533 $where = "del_flg = 0"; 1534 $objQuery->setOrder("rank DESC"); 1535 $objQuery->setLimitOffset(1); 1536 $arrRet = $objQuery->select("deliv_id", "dtb_deliv", $where); 1537 $deliv_id = $arrRet[0]['deliv_id']; 1538 } 1518 function sfGetDelivFee($pref_id, $product_type_id) { 1519 $objQuery =& SC_Query::getSingletonInstance(); 1539 1520 1540 1521 // 配送業者から配送料を取得 … … 1542 1523 1543 1524 // 都道府県が指定されていない場合は、東京都の番号を指定しておく 1544 if($pref == "") {1545 $pref = 13;1525 if($pref_id == "") { 1526 $pref_id = 13; 1546 1527 } 1547 1528 1548 1529 $objQuery =& SC_Query::getSingletonInstance(); 1549 $where = " deliv_id = ? AND pref = ?";1550 $arrRet= $objQuery->select("fee", "dtb_delivfee", $where, array($ deliv_id, $pref));1530 $where = "product_type_id = ? AND pref = ?"; 1531 $arrRet= $objQuery->select("fee", "dtb_delivfee", $where, array($product_type_id, $pref_id)); 1551 1532 } 1552 1533 return $arrRet[0]['fee']; -
branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products_Product.php
r19670 r19688 74 74 $this->arrProductType = $masterData->getMasterData("mtb_product_type"); 75 75 $this->arrMaker = SC_Helper_DB_Ex::sfGetIDValueList("dtb_maker", "maker_id", "name"); 76 $this->arrPayments = SC_Helper_DB_Ex::sfGetIDValueList("dtb_payment", "payment_id", "payment_method"); 76 77 $this->tpl_nonclass = true; 77 78 } -
branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping_Payment.php
r19684 r19688 129 129 $this->arrData = $objCartSess->calculate($this->cartKey, $objCustomer); 130 130 131 // 購入金額の取得 132 $total_inctax = $objCartSess->getAllProductsTotal($this->cartKey); 133 134 // 支払い方法の取得 135 $this->arrPayment = $this->lfGetPayment($total_inctax, $this->cartKey, 136 $objCartSess->getAllProductClassID($this->cartKey)); 137 131 138 if (!isset($_POST['mode'])) $_POST['mode'] = ""; 132 139 … … 171 178 } 172 179 173 // 購入金額の取得174 $total_inctax = $objCartSess->getAllProductsTotal($this->cartKey);175 // 支払い方法の取得176 $this->arrPayment = $this->lfGetPayment($total_inctax);177 180 // 支払い方法の画像があるなしを取得($img_show true:ある false:なし) 178 181 $this->img_show = $this->lfGetImgShow($this->arrPayment); … … 371 374 } 372 375 373 function lfGetPayment($total_inctax) { 376 function lfGetPayment($total_inctax, $productTypeId, $productClassIds) { 377 378 // 有効な支払方法を取得 379 $objProduct = new SC_Product(); 380 $paymentIds = $objProduct->getEnablePaymentIds($productClassIds); 381 $where = 'del_flg = 0 AND payment_id IN (' . implode(', ', array_pad(array(), count($paymentIds), '?')) . ')'; 382 374 383 $objQuery = new SC_Query(); 375 384 $objQuery->setOrder("rank DESC"); 376 377 //削除されていない支払方法を取得378 $arrval = null;379 $where = "del_flg = 0 AND deliv_id IN (SELECT deliv_id FROM dtb_deliv WHERE del_flg = 0) ";380 381 //ダウンロード商品の有無判定382 if($this->cartdown != 0){383 //ダウンロード商品を含む場合は、オンライン決済以外は選択できない。384 $arrval = explode(",", ONLINE_PAYMENT);385 $tmp_where = "";386 foreach ($arrval as $val) {387 if($tmp_where == "") {388 $tmp_where.= "AND payment_id IN ( ?";389 } else {390 $tmp_where.= ",? ";391 }392 }393 $tmp_where.= " ) ";394 $where .= $tmp_where;395 }396 397 385 // 削除されていない支払方法を取得 398 $arrRet = $objQuery->select("payment_id, payment_method, rule, upper_rule, note, payment_image", "dtb_payment", $where, $ arrval);386 $arrRet = $objQuery->select("payment_id, payment_method, rule, upper_rule, note, payment_image", "dtb_payment", $where, $paymentIds); 399 387 400 388 // 配列初期化 … … 402 390 // 選択可能な支払方法を判定 403 391 foreach($arrRet as $data) { 404 //ダウンロード販売に対する注意追加405 if($this->cartdown != 0){406 $data['payment_method'] = $data['payment_method'] . " (ダウンロード商品を含む場合、オンライン決済のみ選択可能です)";407 }408 392 // 下限と上限が設定されている 409 393 if (strlen($data['rule']) != 0 && strlen($data['upper_rule']) != 0) { … … 466 450 $total_inctax = $objCartSess->getAllProductsTotal(); 467 451 // 支払い方法の取得 468 $arrPayment = $this->lfGetPayment($total_inctax); 452 $arrPayment = $this->lfGetPayment($total_inctax, $this->cartKey, 453 $objCartSess->getAllProductClassID($this->cartKey)); 469 454 $pay_flag = true; 470 455 foreach ($arrPayment as $key => $payment) { … … 485 470 $objQuery = new SC_Query(); 486 471 $where = "payment_id = ?"; 487 $arrRet = $objQuery->select("charge , deliv_id", "dtb_payment", $where, array($payment_id));472 $arrRet = $objQuery->select("charge", "dtb_payment", $where, array($payment_id)); 488 473 return (array($arrRet[0]['charge'], $arrRet[0]['deliv_id'])); 489 474 } … … 627 612 628 613 // 配送時間の取得 629 $arrRet = $objDb->sfGetDelivTime($this-> objFormParam->getValue('payment_id'));614 $arrRet = $objDb->sfGetDelivTime($this->cartKey); 630 615 // JSONエンコード 631 616 echo $objJson->encode($arrRet);
Note: See TracChangeset
for help on using the changeset viewer.