From 7ded155a89b84ebbd4fd13b518e53ba34d2ebf1c Mon Sep 17 00:00:00 2001 From: lqmac Date: Mon, 30 Oct 2023 10:06:12 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B2=89=E4=B8=9D=E8=AE=A2=E5=8D=95=E6=80=BB?= =?UTF-8?q?=E6=95=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/User.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/api/controller/User.php b/application/api/controller/User.php index e4b355e..33de1b7 100755 --- a/application/api/controller/User.php +++ b/application/api/controller/User.php @@ -557,8 +557,8 @@ class User extends Api $user_ids = array_column($users, "id"); $data = [ - 'total_fans_order_amount' => order::whereIn('buyer_id', $user_ids)->whereIn('status', [0,1,2,3,4,5,6,7])->sum('order_amount'), - 'today_fans_order_num' => order::whereIn('buyer_id', $user_ids)->whereIn('status', [0,1,2,3,4,5,6,7])->count(), + 'total_fans_order_amount' => $user_ids ? order::whereIn('buyer_id', $user_ids)->whereIn('status', [0,1,2,3,4,5,6,7])->sum('order_amount') : "0.00", + 'today_fans_order_num' => $user_ids ? order::whereIn('buyer_id', $user_ids)->whereIn('status', [0,1,2,3,4,5,6,7])->count() : 0, ]; $this->success("succ", $data); }