This commit is contained in:
aozhiwei 2022-05-13 13:50:16 +08:00
parent 9b125dbc2e
commit 0bc76761aa
4 changed files with 27 additions and 5 deletions

View File

@ -19,5 +19,18 @@ class Ranking(object):
_common.RspHead(),
['ranking_list', _common.RankingList(), '排行榜数据']
]
},
{
'name': 'activityRankingList',
'desc': '获取内试活动排行榜',
'group': 'Ranking',
'url': 'webapp/index.php?c=Ranking&a=activityRankingList',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
['ranking_list', _common.RankingList(), '排行榜数据']
]
}
]

View File

@ -72,4 +72,13 @@ class RankingController extends BaseAuthedController {
));
}
public function activityRankingList()
{
}
private function internalGetActivityRankList($type)
{
}
}

View File

@ -13,8 +13,8 @@ class RankActivity {
public static function isActivityPeriod($meta)
{
return $meta['opentime'] >= myself()->_getNowTime() &&
$meta['closetime'] < myself()->_getNowTime();
return myself()->_getNowTime() >= $meta['opentime'] &&
myself()->_getNowTime() < $meta['closetime'];
}
protected static function getMetaList()

View File

@ -46,7 +46,7 @@ class RankActivityService extends BaseService {
self::OP_SUM);
$this->internalUpdateRankActivity(
self::KILLS_TYPE,
getReqVal('kills_time', 0),
getReqVal('kills', 0),
self::OP_SUM);
}
@ -68,7 +68,7 @@ class RankActivityService extends BaseService {
private function internalUpdateRankActivity($type, $val, $opt)
{
$meta = mt\RankActivity::get(type);
$meta = mt\RankActivity::get($type);
if (!$meta || !mt\RankActivity::isActivityPeriod($meta)) {
return;
}
@ -83,7 +83,7 @@ class RankActivityService extends BaseService {
array(
'value' => function () use($val, $opt) {
if ($opt == self::OP_SUM) {
return "value + ${val})";
return "value + ${val}";
} else if ($opt == self::OP_GREATEST) {
return "GREATEST(0, ${val})";
} else {