From f45f6f63beabf40536724ec3cbbcbb3190786114 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Thu, 18 Jul 2024 17:44:50 +0800 Subject: [PATCH] =?UTF-8?q?feat(IndexController):=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E7=9C=9F=E5=AE=9E=E5=A7=93=E5=90=8D=E8=8E=B7=E5=8F=96=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/statistics/controller/IndexController.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/statistics/controller/IndexController.php b/app/statistics/controller/IndexController.php index f2a7167cf..e04ae905e 100644 --- a/app/statistics/controller/IndexController.php +++ b/app/statistics/controller/IndexController.php @@ -137,7 +137,11 @@ class IndexController extends BaseLikeController // } $res = Db::connect('demo')->name('user_recharge')->where($where)->limit(20)->select()->each(function ($item) { if ($item['uid']) { - $item['nickname'] = Db::connect('demo')->name('user')->where('id', $item['uid'])->value('nickname'); + $find = Db::connect('demo')->name('user')->where('id', $item['uid'])->field('real_name,nickname')->find(); + $item['nickname']=$find['real_name']??''; + if($item['nickname']==''){ + $item['nickname'] = $find['nickname']??''; + } } else { $item['nickname'] = ''; }