Dashboard: fix recent mini bars counts by not casting collection to array
This commit is contained in:
@@ -829,8 +829,10 @@
|
|||||||
@php
|
@php
|
||||||
// 最近平台订单:概览 mini chart(渐进增强)
|
// 最近平台订单:概览 mini chart(渐进增强)
|
||||||
// 目标:让“最近订单列表”也纳入数据图形化体系,但不牺牲明细扫描行。
|
// 目标:让“最近订单列表”也纳入数据图形化体系,但不牺牲明细扫描行。
|
||||||
$recentPos = (array) ($recentPlatformOrders ?? []);
|
// 注意:$recentPlatformOrders 是 Eloquent Collection,可直接 foreach;不要强转 (array)
|
||||||
$recentTotal = count($recentPos);
|
// 否则会变成对象属性数组,导致统计口径全部变 0。
|
||||||
|
$recentPos = $recentPlatformOrders ?? [];
|
||||||
|
$recentTotal = is_countable($recentPos) ? count($recentPos) : 0;
|
||||||
|
|
||||||
$recentCntBmpaSuccess = 0;
|
$recentCntBmpaSuccess = 0;
|
||||||
$recentCntBmpaFailed = 0;
|
$recentCntBmpaFailed = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user