diff --git a/src/Eccube/Repository/ProductRepository.php b/src/Eccube/Repository/ProductRepository.php index 8b4483927f6..8758fb49de4 100644 --- a/src/Eccube/Repository/ProductRepository.php +++ b/src/Eccube/Repository/ProductRepository.php @@ -141,18 +141,14 @@ public function getQueryBuilderBySearchData($searchData) //@see http://doctrine-orm.readthedocs.org/en/latest/reference/dql-doctrine-query-language.html $qb->addSelect('MIN(pc.price02) as HIDDEN price02_min'); $qb->innerJoin('p.ProductClasses', 'pc'); - $qb->groupBy('p'); - // postgres9.0以下は, groupBy('p.id')が利用できない - // mysqlおよびpostgresql9.1以上であればgroupBy('p.id')にすることで性能向上が期待できる. - // @see https://github.com/EC-CUBE/ec-cube/issues/1904 - // $qb->groupBy('p.id'); + $qb->groupBy('p.id'); $qb->orderBy('price02_min', 'ASC'); $qb->addOrderBy('p.id', 'DESC'); // 価格高い順 } else if (!empty($searchData['orderby']) && $searchData['orderby']->getId() == $config['eccube_product_order_price_higher']) { $qb->addSelect('MAX(pc.price02) as HIDDEN price02_max'); $qb->innerJoin('p.ProductClasses', 'pc'); - $qb->groupBy('p'); + $qb->groupBy('p.id'); $qb->orderBy('price02_max', 'DESC'); $qb->addOrderBy('p.id', 'DESC'); // 新着順