36 lines
719 B
PHP
36 lines
719 B
PHP
<?php
|
|
|
|
namespace mt;
|
|
|
|
use phpcommon;
|
|
|
|
class Season {
|
|
|
|
public static function get($id)
|
|
{
|
|
return getXVal(self::getMetaList(), $id);
|
|
}
|
|
|
|
protected static function getMetaList()
|
|
{
|
|
if (!self::$metaList) {
|
|
self::$metaList = getMetaTable('season@season.php');
|
|
}
|
|
return self::$metaList;
|
|
}
|
|
|
|
public static function getCurrentSeason()
|
|
{
|
|
foreach (self::getMetaList() as $meta) {
|
|
if (myself()->_getNowTime() >= strtotime($meta['begin_time']) &&
|
|
myself()->_getNowTime() <= strtotime($meta['end_time'])) {
|
|
return $meta;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
protected static $metaList;
|
|
|
|
}
|