From 20da900dd7c012c4cf9f9ceac884fc149a4d0a2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=92=8A?= Date: Fri, 24 Oct 2025 20:41:38 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/model/BlindBoxTurntableGift.php | 24 ++++--------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/application/api/model/BlindBoxTurntableGift.php b/application/api/model/BlindBoxTurntableGift.php index 826db1c..0987cd7 100644 --- a/application/api/model/BlindBoxTurntableGift.php +++ b/application/api/model/BlindBoxTurntableGift.php @@ -90,19 +90,10 @@ class BlindBoxTurntableGift extends Model $FromUserInfo['icon'][1] = model('UserData')->user_charm_icon($blind_box_turntable['user_id']);//魅力图标 $FromUserInfo['chat_bubble'] = model('Decorate')->user_decorate_detail($blind_box_turntable['user_id'],9);//聊天气泡 $user_nickname = $FromUserInfo['nickname']; - $textMessage = $user_nickname; - $text_message = []; - $ToUserInfosList = []; - $ToUserInfos = []; - $play_image = []; - $gift_names = []; + $userGiftMap = []; foreach ($blind_box_turntable_log as $key => $value) { $ToUserInfo = Db::name('user')->where(['id' => $value['gift_user_id']])->field('id as user_id,nickname,avatar,sex')->find(); $draw_gift = Db::name('vs_gift')->where(['gid'=>$value['gift_id']])->find(); - $textMessage = $textMessage . ' 送给 ' . $ToUserInfo['nickname']. ' 盲盒转盘礼物 ' . $draw_gift['gift_name'].' x ' .$value['count']."\n"; - $play_image[] = $draw_gift['play_image']; - $gift_names[] = $draw_gift['gift_name']; - $text_message = $user_nickname . '在' . $room_name . '房间送给了' . $ToUserInfo['nickname'] . $draw_gift['gift_name'] . 'X' . $value['count']."\n"; if($draw_gift['is_public_server'] == 1) { $text_list_new[] = [ @@ -116,25 +107,18 @@ class BlindBoxTurntableGift extends Model 'number' => $value['count'], ]; } - $ToUserInfosList[$value['gift_user_id']] = $ToUserInfo; - } - // 按用户分组礼物信息 - $userGiftMap = []; - foreach ($blind_box_turntable_log as $value) { $userId = $value['gift_user_id']; if (!isset($userGiftMap[$userId])) { $userGiftMap[$userId] = [ - 'userInfo' => Db::name('user')->where(['id' => $userId])->field('id as user_id,nickname,avatar,sex')->find(), + 'userInfo' => $ToUserInfo, 'gifts' => [] ]; } - - $gift = Db::name('vs_gift')->where(['gid'=>$value['gift_id']])->find(); $userGiftMap[$userId]['gifts'][] = [ - 'gift_name' => $gift['gift_name'], + 'gift_name' => $draw_gift['gift_name'], 'count' => $value['count'], - 'play_image' => $gift['play_image'] + 'play_image' => $draw_gift['play_image'] ]; }