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)
{
$channel = 6516;
$userInfo = $this->_getOrmUserInfo();
$myRanked = array(
'ranked' => -1,
@ -96,21 +97,23 @@ class RankingController extends BaseAuthedController {
if ($meta && mt\RankActivity::isActivityPeriod($meta)) {
$row = myself()->_getSelfMysql()->execQueryOne(
'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(
':type' => $type,
':value' => $meta['cond']
':channel' => $channel,
':value' => $meta['cond'],
)
);
if ($row['row_count'] > 0) {
$count = ceil($row['row_count'] / 10.0);
$rows = myself()->_getSelfMysql()->execQuery(
'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 ' .
"LIMIT ${count}",
array(
':type' => $type,
':channel' => $channel,
':value' => $meta['cond']
)
);