This commit is contained in:
aozhiwei 2022-05-22 11:01:21 +08:00
parent 5672adb004
commit f8b7a902a0

View File

@ -84,6 +84,7 @@ class RankingController extends BaseAuthedController {
private function internalGetActivityRankData($type) private function internalGetActivityRankData($type)
{ {
$channel = 6516;
$userInfo = $this->_getOrmUserInfo(); $userInfo = $this->_getOrmUserInfo();
$myRanked = array( $myRanked = array(
'ranked' => -1, 'ranked' => -1,
@ -96,21 +97,23 @@ class RankingController extends BaseAuthedController {
if ($meta && mt\RankActivity::isActivityPeriod($meta)) { if ($meta && mt\RankActivity::isActivityPeriod($meta)) {
$row = myself()->_getSelfMysql()->execQueryOne( $row = myself()->_getSelfMysql()->execQueryOne(
'SELECT COUNT(*) AS row_count FROM t_rank_activity ' . 'SELECT COUNT(*) AS row_count FROM t_rank_activity ' .
'WHERE type=:type AND value>:value;', 'WHERE type=:type AND channel=:channel AND value>:value;',
array( array(
':type' => $type, ':type' => $type,
':value' => $meta['cond'] ':channel' => $channel,
':value' => $meta['cond'],
) )
); );
if ($row['row_count'] > 0) { if ($row['row_count'] > 0) {
$count = ceil($row['row_count'] / 10.0); $count = ceil($row['row_count'] / 10.0);
$rows = myself()->_getSelfMysql()->execQuery( $rows = myself()->_getSelfMysql()->execQuery(
'SELECT * FROM t_rank_activity ' . 'SELECT * FROM t_rank_activity ' .
'WHERE type=:type AND value>=:value ' . 'WHERE type=:type AND channel=:channel AND value>=:value ' .
'ORDER BY value DESC, modifytime ASC ' . 'ORDER BY value DESC, modifytime ASC ' .
"LIMIT ${count}", "LIMIT ${count}",
array( array(
':type' => $type, ':type' => $type,
':channel' => $channel,
':value' => $meta['cond'] ':value' => $meta['cond']
) )
); );