Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue of EC-CUBE#93 商品一覧の価格順並び替えが登録されていない商品規格に影響される #261

Merged
merged 3 commits into from
Apr 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions data/class/SC_Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ public function findProductIdsOrder(&$objQuery, $arrVal = array())
$o_table = $this->arrOrderData['table'];
$o_order = $this->arrOrderData['order'];
$objQuery->setOrder("T2.$o_col $o_order");
$sub_sql = $objQuery->getSql($o_col, "$o_table AS T2", 'T2.product_id = alldtl.product_id');
$sub_sql = $objQuery->getSql($o_col, "$o_table AS T2", 'T2.product_id = alldtl.product_id AND T2.del_flg = 0');
$sub_sql = $objQuery->dbFactory->addLimitOffset($sub_sql, 1);

$objQuery->setOrder("($sub_sql) $o_order, product_id");
}
$arrReturn = $objQuery->getCol('alldtl.product_id', $table, '', $arrVal);
$arrReturn = $objQuery->getCol('alldtl.product_id', $table, 'alldtl.del_flg = 0', $arrVal);

return $arrReturn;
}
Expand Down
6 changes: 3 additions & 3 deletions tests/class/SC_Product/SC_Product_findProductIdsOrderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function testFindProductIdsOrder_商品ID降順()
{
// 商品ID降順で商品IDを取得する
$this->objQuery->setOrder('product_id DESC');
$this->expected = array('2001','1002', '1001');
$this->expected = array('1002', '1001');

$this->actual = $this->objProducts->findProductIdsOrder($this->objQuery);

Expand All @@ -37,7 +37,7 @@ public function testFindProductIdsOrder_商品名昇順()
{
// 商品名昇順で商品IDを取得する
$this->objQuery->setOrder('product_id ASC');
$this->expected = array('1001', '1002','2001');
$this->expected = array('1001', '1002');

$this->actual = $this->objProducts->findProductIdsOrder($this->objQuery);

Expand All @@ -48,7 +48,7 @@ public function testFindProductIdsOrder_arrOrderDataの設定による並び順(
{
// setProductsOrderを行う
$this->objProducts->setProductsOrder('product_id');
$this->expected = array('1001', '1002','2001');
$this->expected = array('1001', '1002');

$this->actual = $this->objProducts->findProductIdsOrder($this->objQuery);

Expand Down