From 273e7ce61166408df2c3d42f19a1b842899cdbc8 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 31 May 2022 23:06:52 +0800 Subject: [PATCH] 1 --- webapp/controller/RankingController.class.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/webapp/controller/RankingController.class.php b/webapp/controller/RankingController.class.php index 5878590d..6f877bc2 100644 --- a/webapp/controller/RankingController.class.php +++ b/webapp/controller/RankingController.class.php @@ -101,7 +101,7 @@ class RankingController extends BaseAuthedController { ); $rankingList = array(); $meta = mt\RankActivity::get($type); - if ($meta && mt\RankActivity::isActivityPeriod($meta)) { + if ($meta) { $row = myself()->_getSelfMysql()->execQueryOne( 'SELECT COUNT(*) AS row_count FROM t_rank_activity ' . 'WHERE type=:type AND channel=:channel AND value>:value;', @@ -125,6 +125,22 @@ class RankingController extends BaseAuthedController { ) ); $ranked = 1; + foreach ($rows as $row) { + $user = User::find($row['account_id']); + if ($user) { + if ($user['account_id'] == $myRanked['user']['account_id']) { + $myRanked['ranked'] = $ranked; + $myRanked['value'] = $row['value']; + $myRanked['modifytime'] = $row['modifytime']; + } + array_push($rankingList, array( + 'ranked' => $ranked++, + 'user' => User::toSimple($user), + 'value' => $row['value'], + 'modifytime' => $row['modifytime'], + )); + } + } } } {