From d03e1285e42c67c49324163af6a22bdf4db1a559 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=8D=8E=E6=B8=85?= <18691022700@163.com> Date: Mon, 22 Dec 2025 19:23:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E6=97=B6=E6=A6=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/model/RoomHourRanking.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/application/api/model/RoomHourRanking.php b/application/api/model/RoomHourRanking.php index dbb5517c..4a7765b4 100644 --- a/application/api/model/RoomHourRanking.php +++ b/application/api/model/RoomHourRanking.php @@ -118,24 +118,28 @@ class RoomHourRanking extends Model ->whereBetween('b.createtime', [$start_time, $end_time]) ->find(); - if($profit[$k] != null) { + if(!empty($profit[$k])) { $profit[$k]['total_price'] = $profit[$k]['total_price'] * get_system_config_value('coin_charm_exp'); + + // 查询巡乐会状态 if($room_id > 0 && $is_open_xlh == 1){ $xlh_status = model('BlindBoxTurntableGift')->get_user_xlh_info($room_id); - $profit[$k]['xlh_status'] = $xlh_status['xlh_status']; - }else{ + $profit[$k]['xlh_status'] = $xlh_status['xlh_status'] ?? 0; + } else { $profit[$k]['xlh_status'] = 0; } - //查询房间是否有红包 - if($room_id){ - $red_pack_status = Db::name('redpacket')->where(['room_id' => $room_id, 'status' => ['<=',1]])->count(); + + // 查询房间红包状态 + if($room_id > 0){ + $red_pack_status = Db::name('redpacket')->where(['room_id' => $room_id, 'status' => ['<=', 1]])->count(); $profit[$k]['redpacket_status'] = $red_pack_status; - }else{ + } else { $profit[$k]['redpacket_status'] = 0; } } else { unset($profit[$k]); } + } }