Changeset 22567 for branches/version-2_12-dev/data/class/SC_Product.php
- Timestamp:
- 2013/02/18 19:09:54 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/SC_Product.php
r22507 r22567 29 29 * @version $Id$ 30 30 */ 31 class SC_Product { 31 class SC_Product 32 { 32 33 33 34 /** 規格名一覧 */ … … 60 61 * @return void 61 62 */ 62 function setProductsOrder($col, $table = 'dtb_products', $order = 'ASC') { 63 function setProductsOrder($col, $table = 'dtb_products', $order = 'ASC') 64 { 63 65 $this->arrOrderData = array('col' => $col, 'table' => $table, 'order' => $order); 64 66 } … … 73 75 * @return array 商品IDの配列 74 76 */ 75 function findProductIdsOrder(&$objQuery, $arrVal = array()) { 77 function findProductIdsOrder(&$objQuery, $arrVal = array()) 78 { 76 79 $table = 'dtb_products AS alldtl'; 77 80 … … 107 110 * @return array 対象商品ID数 108 111 */ 109 function findProductCount(&$objQuery, $arrVal = array()) { 112 function findProductCount(&$objQuery, $arrVal = array()) 113 { 110 114 $table = 'dtb_products AS alldtl'; 111 115 … … 123 127 * @return array 商品一覧の配列 124 128 */ 125 function lists(&$objQuery) { 129 function lists(&$objQuery) 130 { 126 131 $col = <<< __EOS__ 127 132 product_id … … 165 170 * @return array 商品一覧の配列 (キー: 商品ID) 166 171 */ 167 function getListByProductIds(&$objQuery, $arrProductId = array()) { 172 function getListByProductIds(&$objQuery, $arrProductId = array()) 173 { 168 174 if (empty($arrProductId)) { 169 175 return array(); … … 206 212 * @return array 商品詳細情報の配列 207 213 */ 208 function getDetail($productId) { 214 function getDetail($productId) 215 { 209 216 $objQuery =& SC_Query_Ex::getSingletonInstance(); 210 217 $arrProduct = $objQuery->getRow('*', $this->alldtlSQL('product_id = ?'), … … 225 232 * @return array 商品詳細情報と商品規格の配列 226 233 */ 227 function getDetailAndProductsClass($productClassId) { 234 function getDetailAndProductsClass($productClassId) 235 { 228 236 $result = $this->getProductsClass($productClassId); 229 237 $result = array_merge($result, $this->getDetail($result['product_id'])); … … 242 250 * @return void 243 251 */ 244 function setProductsClassByProductIds($arrProductId, $has_deleted = false) { 252 function setProductsClassByProductIds($arrProductId, $has_deleted = false) 253 { 245 254 246 255 foreach ($arrProductId as $productId) { … … 344 353 * @return array 商品規格の配列 345 354 */ 346 function getProductsClassByQuery(&$objQuery, $params) { 355 function getProductsClassByQuery(&$objQuery, $params) 356 { 347 357 // 末端の規格を取得 348 358 $col = <<< __EOS__ … … 397 407 * @return array 商品規格の配列 398 408 */ 399 function getProductsClass($productClassId) { 409 function getProductsClass($productClassId) 410 { 400 411 $objQuery =& SC_Query_Ex::getSingletonInstance(); 401 412 $objQuery->setWhere('product_class_id = ? AND T1.del_flg = 0'); … … 412 423 * @return array 商品規格の配列 413 424 */ 414 function getProductsClassByProductIds($productIds = array(), $has_deleted = false) { 425 function getProductsClassByProductIds($productIds = array(), $has_deleted = false) 426 { 415 427 if (empty($productIds)) { 416 428 return array(); … … 433 445 * @return array すべての組み合わせの商品規格の配列 434 446 */ 435 function getProductsClassFullByProductId($productId, $has_deleted = false) { 447 function getProductsClassFullByProductId($productId, $has_deleted = false) 448 { 436 449 $arrRet = $this->getProductsClassByProductIds(array($productId), $has_deleted); 437 450 … … 445 458 * @return array 商品IDをキーにした商品ステータスIDの配列 446 459 */ 447 function getProductStatus($productIds) { 460 function getProductStatus($productIds) 461 { 448 462 if (empty($productIds)) { 449 463 return array(); … … 470 484 * @param array $productStatusIds ON にする商品ステータスIDの配列 471 485 */ 472 function setProductStatus($productId, $productStatusIds) { 486 function setProductStatus($productId, $productStatusIds) 487 { 473 488 474 489 $val['product_id'] = $productId; … … 496 511 * @see getDetailAndProductsClass() 497 512 */ 498 function getBuyLimit($p) { 513 function getBuyLimit($p) 514 { 499 515 $limit = null; 500 516 if ($p['stock_unlimited'] != '1' && is_numeric($p['sale_limit'])) { … … 521 537 * @return boolean 在庫の減少に成功した場合 true; 失敗した場合 false 522 538 */ 523 function reduceStock($productClassId, $quantity) { 539 function reduceStock($productClassId, $quantity) 540 { 524 541 525 542 if ($quantity == 0) { … … 549 566 * @return array 旧バージョン互換用のデータ 550 567 */ 551 static function setPriceTaxTo(&$arrProducts) { 568 static function setPriceTaxTo(&$arrProducts) 569 { 552 570 foreach ($arrProducts as &$arrProduct) { 553 571 $arrProduct['price01_min_format'] = number_format($arrProduct['price01_min']); … … 583 601 * @return void 584 602 */ 585 static function setIncTaxToProducts(&$arrProducts) { 603 static function setIncTaxToProducts(&$arrProducts) 604 { 586 605 foreach ($arrProducts as &$arrProduct) { 587 606 SC_Product_Ex::setIncTaxToProduct($arrProduct); … … 595 614 * @return void 596 615 */ 597 static function setIncTaxToProduct(&$arrProduct) { 616 static function setIncTaxToProduct(&$arrProduct) 617 { 598 618 $arrProduct['price01_min_inctax'] = isset($arrProduct['price01_min']) ? SC_Helper_DB_Ex::sfCalcIncTax($arrProduct['price01_min']) : null; 599 619 $arrProduct['price01_max_inctax'] = isset($arrProduct['price01_max']) ? SC_Helper_DB_Ex::sfCalcIncTax($arrProduct['price01_max']) : null; … … 608 628 * @return string 商品詳細の SQL 609 629 */ 610 function alldtlSQL($where_products_class = '') { 630 function alldtlSQL($where_products_class = '') 631 { 611 632 if (!SC_Utils_Ex::isBlank($where_products_class)) { 612 633 $where_products_class = 'AND (' . $where_products_class . ')'; … … 715 736 * @return string 商品規格詳細の SQL 716 737 */ 717 function prdclsSQL($where = '') { 738 function prdclsSQL($where = '') 739 { 718 740 $where_clause = ''; 719 741 if (!SC_Utils_Ex::isBlank($where)) {
Note: See TracChangeset
for help on using the changeset viewer.
