feat(IndexController): 增加真实姓名获取功能

This commit is contained in:
mkm 2024-07-18 17:44:50 +08:00
parent 3be7efb356
commit f45f6f63be

View File

@ -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'] = '';
}