Changeset 18052 for branches/comu-ver2/data/class/helper/SC_Helper_DB.php
- Timestamp:
- 2009/06/06 03:19:45 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/comu-ver2/data/class/helper/SC_Helper_DB.php
r18044 r18052 201 201 * 店舗基本情報を取得する. 202 202 * 203 * @param boolean $force 強制的にDB取得するか 203 204 * @return array 店舗基本情報の配列 204 205 */ 205 function sf_getBasisData() { 206 $objQuery = new SC_Query(); 207 $arrRet = $objQuery->select('*', 'dtb_baseinfo'); 208 209 if (isset($arrRet[0])) return $arrRet[0]; 210 211 return array(); 206 function sf_getBasisData($force = false) { 207 static $data; 208 209 if ($force || !isset($data)) { 210 $objQuery = new SC_Query(); 211 $arrRet = $objQuery->select('*', 'dtb_baseinfo'); 212 213 if (isset($arrRet[0])) { 214 $data = $arrRet[0]; 215 } else { 216 $data = array(); 217 } 218 } 219 220 return $data; 212 221 } 213 222 … … 282 291 * @param LC_Page $objPage ページクラスのインスタンス 283 292 * @param SC_CartSession $objCartSess カートセッションのインスタンス 284 * @param array $arrInfo 商品情報の配列285 293 * @return LC_Page 集計処理後のページクラスインスタンス 286 294 */ 287 function sfTotalCart(&$objPage, $objCartSess , $arrInfo) {295 function sfTotalCart(&$objPage, $objCartSess) { 288 296 289 297 // 規格名一覧 … … 372 380 } 373 381 // 商品ごとの合計金額 374 $objPage->arrProductsClass[$cnt]['total_pretax'] = $objCartSess->getProductTotal($arr Info, $arrCart['id']);382 $objPage->arrProductsClass[$cnt]['total_pretax'] = $objCartSess->getProductTotal($arrCart['id']); 375 383 // 送料の合計を計算する 376 384 $objPage->tpl_total_deliv_fee+= ($arrData['deliv_fee'] * $arrCart['quantity']); … … 394 402 395 403 // 全商品合計金額(税込み) 396 $objPage->tpl_total_pretax = $objCartSess->getAllProductsTotal( $arrInfo);404 $objPage->tpl_total_pretax = $objCartSess->getAllProductsTotal(); 397 405 // 全商品合計消費税 398 $objPage->tpl_total_tax = $objCartSess->getAllProductsTax( $arrInfo);406 $objPage->tpl_total_tax = $objCartSess->getAllProductsTax(); 399 407 // 全商品合計ポイント 400 408 if (USE_POINT !== false) { … … 1480 1488 * @param LC_Page $objPage LC_Page インスタンス 1481 1489 * @param SC_CartSession $objCartSess SC_CartSession インスタンス 1482 * @param array $arrInfo 店舗情報の配列1483 1490 * @param SC_Customer $objCustomer SC_Customer インスタンス 1484 1491 * @return array 最終計算後の配列 1485 1492 */ 1486 function sfTotalConfirm($arrData, &$objPage, &$objCartSess, $arrInfo, $objCustomer = "") { 1493 function sfTotalConfirm($arrData, &$objPage, &$objCartSess, $objCustomer = "") { 1494 // 店舗基本情報を取得する 1495 $arrInfo = SC_Helper_DB_Ex::sf_getBasisData(); 1496 1487 1497 // 未定義変数を定義 1488 1498 if (!isset($arrData['deliv_pref'])) $arrData['deliv_pref'] = ""; … … 1538 1548 // 加算ポイントの計算 1539 1549 if (USE_POINT !== false) { 1540 $arrData['add_point'] = SC_ Utils::sfGetAddPoint($objPage->tpl_total_point, $arrData['use_point'], $arrInfo);1550 $arrData['add_point'] = SC_Helper_DB_Ex::sfGetAddPoint($objPage->tpl_total_point, $arrData['use_point']); 1541 1551 1542 1552 if($objCustomer != "") { … … 1748 1758 $objQuery->query($sql, array($order_id)); 1749 1759 } 1760 1761 /** 1762 * 店舗基本情報に基づいて税金額を返す 1763 * 1764 * @param integer $price 計算対象の金額 1765 * @return integer 税金額 1766 */ 1767 function sfTax($price) { 1768 // 店舗基本情報を取得 1769 $CONF = SC_Helper_DB_Ex::sf_getBasisData(); 1770 1771 return SC_Utils_Ex::sfTax($price, $CONF['tax'], $CONF['tax_rule']); 1772 } 1773 1774 /** 1775 * 店舗基本情報に基づいて税金付与した金額を返す 1776 * 1777 * @param integer $price 計算対象の金額 1778 * @return integer 税金付与した金額 1779 */ 1780 function sfPreTax($price, $tax = null, $tax_rule = null) { 1781 // 店舗基本情報を取得 1782 $CONF = SC_Helper_DB_Ex::sf_getBasisData(); 1783 1784 return SC_Utils_Ex::sfPreTax($price, $CONF['tax'], $CONF['tax_rule']); 1785 } 1786 1787 /** 1788 * 店舗基本情報に基づいて加算ポイントを返す 1789 * 1790 * @param integer $totalpoint 1791 * @param integer $use_point 1792 * @return integer 加算ポイント 1793 */ 1794 function sfGetAddPoint($totalpoint, $use_point) { 1795 // 店舗基本情報を取得 1796 $CONF = SC_Helper_DB_Ex::sf_getBasisData(); 1797 1798 return SC_Utils_Ex::sfGetAddPoint($totalpoint, $use_point, $CONF['point_rate']); 1799 } 1750 1800 } 1751 1801 ?>
Note: See TracChangeset
for help on using the changeset viewer.