platform orders: add 24h batch BMPA summary stat and card
This commit is contained in:
@@ -310,6 +310,21 @@ class PlatformOrderController extends Controller
|
||||
|
||||
return $q->count();
|
||||
})(),
|
||||
'batch_mark_paid_and_activate_24h_orders' => (function () use ($baseQuery) {
|
||||
$since = now()->subHours(24)->format('Y-m-d H:i:s');
|
||||
|
||||
$q = (clone $baseQuery)
|
||||
->whereRaw("JSON_EXTRACT(meta, '$.batch_mark_paid_and_activate.at') IS NOT NULL");
|
||||
|
||||
$driver = $q->getQuery()->getConnection()->getDriverName();
|
||||
if ($driver === 'sqlite') {
|
||||
$q->whereRaw("JSON_EXTRACT(meta, '$.batch_mark_paid_and_activate.at') >= ?", [$since]);
|
||||
} else {
|
||||
$q->whereRaw("JSON_UNQUOTE(JSON_EXTRACT(meta, '$.batch_mark_paid_and_activate.at')) >= ?", [$since]);
|
||||
}
|
||||
|
||||
return $q->count();
|
||||
})(),
|
||||
'batch_mark_activated_24h_orders' => (function () use ($baseQuery) {
|
||||
$since = now()->subHours(24)->format('Y-m-d H:i:s');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user