diff --git a/app/Domains/Stats/Exports/CompanyReportDetailExport.php b/app/Domains/Stats/Exports/CompanyReportDetailExport.php index 06323d7b..d78e499b 100644 --- a/app/Domains/Stats/Exports/CompanyReportDetailExport.php +++ b/app/Domains/Stats/Exports/CompanyReportDetailExport.php @@ -43,7 +43,6 @@ class CompanyReportDetailExport extends AbstractExport implements FromQuery, Wit 'sim', 'company_id', 'package_id', - 'order_id', 'type', DB::raw('CASE "type" WHEN 3 THEN SUM(counts) ELSE count(*) END AS counts'), 'unit_price' @@ -51,7 +50,7 @@ class CompanyReportDetailExport extends AbstractExport implements FromQuery, Wit $builder = $repository->forceNoReset()->select($select) ->withConditions($this->conditions) - ->groupBy('sim') + ->groupBy('company_id', 'package_id', 'type', 'unit_price', 'sim') ->orderBy('id', 'desc'); return $builder; diff --git a/app/Domains/Stats/Services/CompanyReportService.php b/app/Domains/Stats/Services/CompanyReportService.php index 059cb493..2d62c6ed 100644 --- a/app/Domains/Stats/Services/CompanyReportService.php +++ b/app/Domains/Stats/Services/CompanyReportService.php @@ -79,7 +79,6 @@ class CompanyReportService extends Service 'sim', 'company_id', 'package_id', - 'order_id', 'type', DB::raw('CASE "type" WHEN 3 THEN SUM(counts) ELSE count(*) END AS counts'), 'unit_price' @@ -87,7 +86,7 @@ class CompanyReportService extends Service $query = $this->orderCardPartitionRepository->select($select) ->withConditions($conditions) - ->groupBy('sim') + ->groupBy('company_id', 'package_id', 'type', 'unit_price', 'sim') ->orderBy('id', 'desc'); $res = $query->paginate($conditions['limit']);