feat(platform-orders): 摘要卡增加无回执订单数并补快捷筛选入口
This commit is contained in:
@@ -282,7 +282,16 @@ class PlatformOrderController extends Controller
|
||||
'partially_refunded_orders' => (clone $baseQuery)->where('payment_status', 'partially_refunded')->count(),
|
||||
'refunded_orders' => (clone $baseQuery)->where('payment_status', 'refunded')->count(),
|
||||
'total_refunded_amount' => $totalRefundedAmount,
|
||||
'receipt_orders' => (clone $baseQuery)->whereRaw("JSON_EXTRACT(meta, '$.payment_receipts[0].amount') IS NOT NULL")->count(),
|
||||
'receipt_orders' => (clone $baseQuery)
|
||||
->where(function (Builder $q) {
|
||||
$q->whereRaw("JSON_EXTRACT(meta, '$.payment_summary.total_amount') IS NOT NULL")
|
||||
->orWhereRaw("JSON_EXTRACT(meta, '$.payment_receipts[0].amount') IS NOT NULL");
|
||||
})
|
||||
->count(),
|
||||
'no_receipt_orders' => (clone $baseQuery)
|
||||
->whereRaw("JSON_EXTRACT(meta, '$.payment_summary.total_amount') IS NULL")
|
||||
->whereRaw("JSON_EXTRACT(meta, '$.payment_receipts[0].amount') IS NULL")
|
||||
->count(),
|
||||
'total_receipt_amount' => $totalReceiptAmount,
|
||||
// 对账差额:回执总额 - 订单已付总额(当前筛选范围)
|
||||
'reconciliation_delta' => (float) ($totalReceiptAmount - $totalPaidAmount),
|
||||
|
||||
Reference in New Issue
Block a user