From b881a5d98db719eae436d80965ea41365b53295e Mon Sep 17 00:00:00 2001 From: Shikha Mishra Date: Fri, 12 Apr 2019 00:41:22 +0530 Subject: [PATCH 1/3] Fixed #22223 Missing/Wrong data display on downloadable report table reports>downloads in BO --- .../ResourceModel/Product/Downloads/Collection.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/code/Magento/Reports/Model/ResourceModel/Product/Downloads/Collection.php b/app/code/Magento/Reports/Model/ResourceModel/Product/Downloads/Collection.php index 1985db0b90e2a..a7932e8a11f81 100644 --- a/app/code/Magento/Reports/Model/ResourceModel/Product/Downloads/Collection.php +++ b/app/code/Magento/Reports/Model/ResourceModel/Product/Downloads/Collection.php @@ -97,4 +97,15 @@ public function addFieldToFilter($field, $condition = null) } return $this; } + + /** + * Get SQL for get record count without left JOINs and group + * + * @return \Magento\Framework\DB\Select + */ + public function getSelectCountSql() { + $countSelect = parent::getSelectCountSql(); + $countSelect->reset(\Zend\Db\Sql\Select::GROUP); + return $countSelect; + } } From bf8e919b4bf203cc6caa59ceee668ff7eddc8a58 Mon Sep 17 00:00:00 2001 From: Yaroslav Rogoza Date: Sat, 13 Apr 2019 09:01:11 +0200 Subject: [PATCH 2/3] Code style fix --- .../Model/ResourceModel/Product/Downloads/Collection.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Reports/Model/ResourceModel/Product/Downloads/Collection.php b/app/code/Magento/Reports/Model/ResourceModel/Product/Downloads/Collection.php index a7932e8a11f81..aeb0448f8e05a 100644 --- a/app/code/Magento/Reports/Model/ResourceModel/Product/Downloads/Collection.php +++ b/app/code/Magento/Reports/Model/ResourceModel/Product/Downloads/Collection.php @@ -103,7 +103,8 @@ public function addFieldToFilter($field, $condition = null) * * @return \Magento\Framework\DB\Select */ - public function getSelectCountSql() { + public function getSelectCountSql() + { $countSelect = parent::getSelectCountSql(); $countSelect->reset(\Zend\Db\Sql\Select::GROUP); return $countSelect; From 0453184879c5957d7ec4c903b9148c8ea35e43c1 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky Date: Tue, 16 Apr 2019 16:18:59 +0300 Subject: [PATCH 3/3] magento/magento2#22291: Static test fix. --- .../Product/Downloads/Collection.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/Reports/Model/ResourceModel/Product/Downloads/Collection.php b/app/code/Magento/Reports/Model/ResourceModel/Product/Downloads/Collection.php index aeb0448f8e05a..2009cd3ff9d92 100644 --- a/app/code/Magento/Reports/Model/ResourceModel/Product/Downloads/Collection.php +++ b/app/code/Magento/Reports/Model/ResourceModel/Product/Downloads/Collection.php @@ -4,16 +4,16 @@ * See COPYING.txt for license details. */ +namespace Magento\Reports\Model\ResourceModel\Product\Downloads; + /** * Product Downloads Report collection * * @author Magento Core Team - */ -namespace Magento\Reports\Model\ResourceModel\Product\Downloads; - -/** + * * @api * @since 100.0.2 + * @SuppressWarnings(PHPMD.CookieAndSessionMisuse) */ class Collection extends \Magento\Catalog\Model\ResourceModel\Product\Collection { @@ -97,13 +97,11 @@ public function addFieldToFilter($field, $condition = null) } return $this; } - + /** - * Get SQL for get record count without left JOINs and group - * - * @return \Magento\Framework\DB\Select + * @inheritDoc */ - public function getSelectCountSql() + public function getSelectCountSql() { $countSelect = parent::getSelectCountSql(); $countSelect->reset(\Zend\Db\Sql\Select::GROUP);