|
|
@@ -27,6 +27,7 @@ class OrderPackageExceptionTypeCountingRecordService
|
|
|
])
|
|
|
->where('sent_at', '>=', now()->subDays($days)->startOfDay())
|
|
|
->whereNotNull(['owner_id', 'sent_at'])
|
|
|
+ ->where('exception_type','!=','无')
|
|
|
->groupBy(['exception_type',
|
|
|
'sent_at_date',
|
|
|
'owner_id'])->orderBy('sent_at_date')->chunk(1000, function ($items) {
|
|
|
@@ -47,6 +48,7 @@ class OrderPackageExceptionTypeCountingRecordService
|
|
|
->where('sent_at', '>=', Carbon::parse($date)->startOfDay())
|
|
|
->where('sent_at', '<=', Carbon::parse($date)->endOfDay())
|
|
|
->whereNotNull(['owner_id', 'sent_at'])
|
|
|
+ ->where('exception_type','!=','无')
|
|
|
->groupBy(['exception_type',
|
|
|
'sent_at_date',
|
|
|
'owner_id'])->orderBy('sent_at_date')->chunk(1000, function ($items) {
|
|
|
@@ -62,6 +64,7 @@ class OrderPackageExceptionTypeCountingRecordService
|
|
|
->select(['exception_type', DB::raw('sum(exception_type_count) as count')])
|
|
|
->where('sent_at_date', '>=', Carbon::parse($kvPairs['start_date'])->startOfDay())
|
|
|
->where('sent_at_date', '<=', Carbon::parse($kvPairs['end_date'])->endOfDay())
|
|
|
+ ->where('exception_type','!=','无')
|
|
|
->whereIn('owner_id', $kvPairs['owner_ids'])
|
|
|
->groupBy('exception_type')->get();
|
|
|
}
|