game2006api/webapp/mt/Season.php
aozhiwei d1281dd941 1
2021-12-02 17:46:59 +08:00

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;
}