43 lines
920 B
PHP
43 lines
920 B
PHP
<?php
|
|
|
|
namespace mt;
|
|
|
|
use phpcommon;
|
|
|
|
class RankActivity {
|
|
|
|
public static function get($id)
|
|
{
|
|
return array_key_exists($id, self::getMetaList()) ? self::getMetaList()[$id] : null;
|
|
}
|
|
|
|
public static function getOpenList()
|
|
{
|
|
$list = array();
|
|
foreach (self::getMetaList() as $meta) {
|
|
if ($meta['opentime'] <= myself()->_getNowTime()) {
|
|
array_push($list, $meta['id']);
|
|
}
|
|
}
|
|
return $list;
|
|
}
|
|
|
|
public static function isActivityPeriod($meta)
|
|
{
|
|
return myself()->_getNowTime() >= $meta['opentime'] &&
|
|
myself()->_getNowTime() < $meta['closetime'];
|
|
}
|
|
|
|
protected static function getMetaList()
|
|
{
|
|
if (!self::$metaList) {
|
|
self::$metaList = getMetaTable('rankActivity@rankActivity.php');
|
|
}
|
|
return self::$metaList;
|
|
}
|
|
|
|
|
|
protected static $metaList;
|
|
|
|
}
|