From 2fb4b136ed67eb131f15b4819290a393485ca1cd 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, 29 Sep 2025 14:12:04 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=88=BF=E9=97=B4=E5=B0=8F=E6=97=B6?= =?UTF-8?q?=E6=A6=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/controller/RoomHourRanking.php | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 application/api/controller/RoomHourRanking.php diff --git a/application/api/controller/RoomHourRanking.php b/application/api/controller/RoomHourRanking.php new file mode 100644 index 0000000..2bf5057 --- /dev/null +++ b/application/api/controller/RoomHourRanking.php @@ -0,0 +1,51 @@ +order('id', 'desc')->value('open_time'); + return V(1, '获取成功', ['open_time' => $open_time]); + } + + //房间小时榜玩法 + public function room_hour_ranking_play() + { + $introd = db::name('vs_hour_ranking_config')->order('id', 'desc')->value('introd'); + return V(1, '获取成功', ['introd' => $introd]); + } + + //房间小时榜 + public function room_hour_ranking() + { + //判断是否开启 + $open_time = db::name('vs_hour_ranking_config')->order('id', 'desc')->value('open_time'); + if ($open_time = 0) { + return V(0, '排行榜暂未开启'); + } + + //当前小时开始时间 + $start_time = strtotime(date('Y-m-d H:00:00')); + $profit = db::name('vs_room')->alias('a') + ->join('vs_give_gift b', 'a.id = b.room_id','left') + ->join('vs_room_label c', 'a.label_id = c.id','left') + ->field('a.id as room_id,a.room_name,a.label_id,a.room_cover,sum(b.total_price) as total_price,c.label_icon') + ->where('b.from',2) + ->where('b.createtime', 'between', [$start_time, time()]) + ->order('total_price', 'desc') + ->limit(20) + ->select(); + if($profit){ + foreach ($profit as $k => $v) { + $xlh_status = model('BlindBoxTurntableGift')->get_user_xlh_info($v['room_id']); + $profit[$k]['xlh_status'] = $xlh_status['xlh_status']; + } + } + return V(1, '获取成功', $profit); + } +} \ No newline at end of file From bd3af537ccbdbe46087e9686ecc26df9ff9e13f1 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, 29 Sep 2025 14:14:20 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E6=88=BF=E9=97=B4=E5=B0=8F=E6=97=B6?= =?UTF-8?q?=E6=A6=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/RoomHourRanking.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/api/controller/RoomHourRanking.php b/application/api/controller/RoomHourRanking.php index 2bf5057..3e5c8e2 100644 --- a/application/api/controller/RoomHourRanking.php +++ b/application/api/controller/RoomHourRanking.php @@ -32,7 +32,7 @@ class RoomHourRanking //当前小时开始时间 $start_time = strtotime(date('Y-m-d H:00:00')); $profit = db::name('vs_room')->alias('a') - ->join('vs_give_gift b', 'a.id = b.room_id','left') + ->join('vs_give_gift b', 'a.id = b.from_id','left') ->join('vs_room_label c', 'a.label_id = c.id','left') ->field('a.id as room_id,a.room_name,a.label_id,a.room_cover,sum(b.total_price) as total_price,c.label_icon') ->where('b.from',2) From 5e5185a92a1394d18df3320a1c73c54c7b47a58e 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, 29 Sep 2025 14:18:14 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=88=BF=E9=97=B4=E5=B0=8F=E6=97=B6?= =?UTF-8?q?=E6=A6=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/RoomHourRanking.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/application/api/controller/RoomHourRanking.php b/application/api/controller/RoomHourRanking.php index 3e5c8e2..428181d 100644 --- a/application/api/controller/RoomHourRanking.php +++ b/application/api/controller/RoomHourRanking.php @@ -42,8 +42,9 @@ class RoomHourRanking ->select(); if($profit){ foreach ($profit as $k => $v) { - $xlh_status = model('BlindBoxTurntableGift')->get_user_xlh_info($v['room_id']); - $profit[$k]['xlh_status'] = $xlh_status['xlh_status']; +// $xlh_status = model('BlindBoxTurntableGift')->get_user_xlh_info($v['room_id']); +// $profit[$k]['xlh_status'] = $xlh_status['xlh_status']; + $profit[$k]['xlh_status'] = 1; } } return V(1, '获取成功', $profit); From c08578072da621af520abf1c9c76c6b7b2006f49 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, 29 Sep 2025 14:21:42 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E6=88=BF=E9=97=B4=E5=B0=8F=E6=97=B6?= =?UTF-8?q?=E6=A6=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/RoomHourRanking.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/api/controller/RoomHourRanking.php b/application/api/controller/RoomHourRanking.php index 428181d..bbad432 100644 --- a/application/api/controller/RoomHourRanking.php +++ b/application/api/controller/RoomHourRanking.php @@ -38,7 +38,7 @@ class RoomHourRanking ->where('b.from',2) ->where('b.createtime', 'between', [$start_time, time()]) ->order('total_price', 'desc') - ->limit(20) +// ->limit(20) ->select(); if($profit){ foreach ($profit as $k => $v) { From 3c9c22a2dc36e0fed990d809e8d0179c46bb8dda 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, 29 Sep 2025 14:23:25 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E6=88=BF=E9=97=B4=E5=B0=8F=E6=97=B6?= =?UTF-8?q?=E6=A6=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/RoomHourRanking.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/application/api/controller/RoomHourRanking.php b/application/api/controller/RoomHourRanking.php index bbad432..859e461 100644 --- a/application/api/controller/RoomHourRanking.php +++ b/application/api/controller/RoomHourRanking.php @@ -41,10 +41,10 @@ class RoomHourRanking // ->limit(20) ->select(); if($profit){ - foreach ($profit as $k => $v) { -// $xlh_status = model('BlindBoxTurntableGift')->get_user_xlh_info($v['room_id']); -// $profit[$k]['xlh_status'] = $xlh_status['xlh_status']; - $profit[$k]['xlh_status'] = 1; + foreach ($profit as $v) { + $xlh_status = model('BlindBoxTurntableGift')->get_user_xlh_info($v['room_id']); + $v['xlh_status'] = $xlh_status['xlh_status']; +// $v['xlh_status'] = 1; } } return V(1, '获取成功', $profit);