From 70396159271c90e984c3238cbaeb66355cd83dae Mon Sep 17 00:00:00 2001 From: Seasoft Date: Mon, 27 Oct 2014 02:22:40 +0000 Subject: [PATCH] =?UTF-8?q?#2644=20(SC=5FDB=5FDBFactory::alldtlSQL=20?= =?UTF-8?q?=E3=81=8B=E3=82=89=20class=5Fcount=20=E3=82=92=E5=89=8A?= =?UTF-8?q?=E9=99=A4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/class/db/SC_DB_DBFactory.php | 28 +++++++++---------- .../db/dbfactory/SC_DB_DBFactory_PGSQL.php | 1 - .../SC_CartSession_getCartListTest.php | 1 - ..._Product_getDetailAndProductsClassTest.php | 1 - .../SC_Product/SC_Product_getDetailTest.php | 1 - 5 files changed, 13 insertions(+), 19 deletions(-) diff --git a/data/class/db/SC_DB_DBFactory.php b/data/class/db/SC_DB_DBFactory.php index 7f8605b23e5..a144512f6d1 100644 --- a/data/class/db/SC_DB_DBFactory.php +++ b/data/class/db/SC_DB_DBFactory.php @@ -267,24 +267,22 @@ public function alldtlSQL($where_products_class = '') ,T4.stock_unlimited_max ,T4.point_rate ,T4.deliv_fee - ,T4.class_count ,dtb_maker.name AS maker_name FROM dtb_products INNER JOIN ( - SELECT product_id, - MIN(product_code) AS product_code_min, - MAX(product_code) AS product_code_max, - MIN(price01) AS price01_min, - MAX(price01) AS price01_max, - MIN(price02) AS price02_min, - MAX(price02) AS price02_max, - MIN(stock) AS stock_min, - MAX(stock) AS stock_max, - MIN(stock_unlimited) AS stock_unlimited_min, - MAX(stock_unlimited) AS stock_unlimited_max, - MAX(point_rate) AS point_rate, - MAX(deliv_fee) AS deliv_fee, - COUNT(*) as class_count + SELECT product_id + ,MIN(product_code) AS product_code_min + ,MAX(product_code) AS product_code_max + ,MIN(price01) AS price01_min + ,MAX(price01) AS price01_max + ,MIN(price02) AS price02_min + ,MAX(price02) AS price02_max + ,MIN(stock) AS stock_min + ,MAX(stock) AS stock_max + ,MIN(stock_unlimited) AS stock_unlimited_min + ,MAX(stock_unlimited) AS stock_unlimited_max + ,MAX(point_rate) AS point_rate + ,MAX(deliv_fee) AS deliv_fee FROM dtb_products_class WHERE del_flg = 0 $where_products_class GROUP BY product_id diff --git a/data/class/db/dbfactory/SC_DB_DBFactory_PGSQL.php b/data/class/db/dbfactory/SC_DB_DBFactory_PGSQL.php index 6df2a5801ce..0f43631a200 100644 --- a/data/class/db/dbfactory/SC_DB_DBFactory_PGSQL.php +++ b/data/class/db/dbfactory/SC_DB_DBFactory_PGSQL.php @@ -317,7 +317,6 @@ public function alldtlSQL($where_products_class = '') ,(SELECT MAX(stock_unlimited) $sub_base) AS stock_unlimited_max ,(SELECT MAX(point_rate) $sub_base) AS point_rate ,(SELECT MAX(deliv_fee) $sub_base) AS deliv_fee - ,(SELECT COUNT(*) $sub_base) AS class_count FROM dtb_products LEFT JOIN dtb_maker ON dtb_products.maker_id = dtb_maker.maker_id diff --git a/tests/class/SC_CartSession/SC_CartSession_getCartListTest.php b/tests/class/SC_CartSession/SC_CartSession_getCartListTest.php index ab86a3cb8c0..a7dbce3dd4f 100644 --- a/tests/class/SC_CartSession/SC_CartSession_getCartListTest.php +++ b/tests/class/SC_CartSession/SC_CartSession_getCartListTest.php @@ -141,7 +141,6 @@ public function getCartList_商品を1つ追加した場合商品データを返 ,'creator_id' => '1' ,'point_rate' => '0' ,'deliv_fee' => null - ,'class_count' => '1' ,'maker_name' => null ,'stock' => '99' ,'stock_unlimited' => '0' diff --git a/tests/class/SC_Product/SC_Product_getDetailAndProductsClassTest.php b/tests/class/SC_Product/SC_Product_getDetailAndProductsClassTest.php index 3c87f9dd384..bb03aad7431 100644 --- a/tests/class/SC_Product/SC_Product_getDetailAndProductsClassTest.php +++ b/tests/class/SC_Product/SC_Product_getDetailAndProductsClassTest.php @@ -89,7 +89,6 @@ public function testGetDetailAndProductsClass_商品規格IDの商品情報と ,'create_date' => $arrRet[0] ,'point_rate' => '0' ,'deliv_fee' => null - ,'class_count' => '1' ,'maker_name' => null ,'stock' => '99' ,'stock_unlimited' => '0' diff --git a/tests/class/SC_Product/SC_Product_getDetailTest.php b/tests/class/SC_Product/SC_Product_getDetailTest.php index c3151277dba..f11f32d2564 100644 --- a/tests/class/SC_Product/SC_Product_getDetailTest.php +++ b/tests/class/SC_Product/SC_Product_getDetailTest.php @@ -89,7 +89,6 @@ public function testGetDetail_商品IDの詳細情報を返す() ,'create_date' => $arrRet[0] ,'point_rate' => '0' ,'deliv_fee' => null - ,'class_count' => '1' ,'maker_name' => null );