From 8cb2d0bba24d3fdaa7f37cda7a5a088ad5aaf94c Mon Sep 17 00:00:00 2001 From: wanghousheng Date: Wed, 17 Jul 2024 10:19:22 +0800 Subject: [PATCH] 1 --- app/api/controller/Invite.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/api/controller/Invite.php b/app/api/controller/Invite.php index 3db15c4b..0de296b0 100644 --- a/app/api/controller/Invite.php +++ b/app/api/controller/Invite.php @@ -108,8 +108,10 @@ class Invite extends Controller ->paginate(15); $data['list'] = $list->items(); if (!empty($data['list'])) { - foreach ($data['list'] as &$item) { - $item['create_time'] = date('Y-m-d H:i:s', $item['create_time']); + foreach ($data['list'] as $key => $item) { + if (!empty($item->create_time)) { + $data['list'][$key]->create_time = date('Y-m-d H:i:s', $item->create_time); + } } } $data['total'] = $list->total();