This commit is contained in:
aozhiwei 2021-12-02 17:46:59 +08:00
parent 6ade0c4307
commit d1281dd941

View File

@ -8,7 +8,7 @@ class Season {
public static function get($id)
{
return array_key_exists($id, self::getMetaList()) ? self::getMetaList()[$id] : null;
return getXVal(self::getMetaList(), $id);
}
protected static function getMetaList()
@ -19,89 +19,17 @@ class Season {
return self::$metaList;
}
public static function getSeasonRewardByLv($lv)
{
$seasonCfg = self::getMetaList();
return $seasonCfg;
}
public static function getSeasonCfg()
{
$seasonCfg = self::getMetaList();
return $seasonCfg;
}
public static function getTaskCfgByID($_itemID)
{
$playerSkinCfg = self::getMetaList();
$itemData = null;
foreach($playerSkinCfg as $item)
{
$tmpItemID = $item["id"];
if($tmpItemID == $_itemID)
{
$itemData = $item;
break;
}
}
return $itemData;
}
public static function getOldSeason($id)
{
$meta = self::get($id);
return array(
'number' => $meta['season_number'],
'open_time' => $meta['time1'],
'end_time' => $meta['time2'],
'reward' => $meta['season_reward'],
#'weekreward' => $meta['week_reward'],
'season_overreward' => $meta['season_overreward'],
'reward2' => $meta['season_reward2'],
);
}
public static function getCurrSeasonTime()
{
$seasonTime = 0;
foreach (self::getMetaList() as $meta) {
if (phpcommon\getNowTime() >= strtotime($meta['open_time']) &&
phpcommon\getNowTime() <= strtotime($meta['end_time'])) {
$seasonTime = strtotime($meta['end_time']);
break;
}
}
return $seasonTime;
}
public static function getNowSeason()
public static function getCurrentSeason()
{
foreach (self::getMetaList() as $meta) {
if (phpcommon\getNowTime() >= strtotime($meta['open_time']) &&
phpcommon\getNowTime() <= strtotime($meta['end_time'])) {
if (myself()->_getNowTime() >= strtotime($meta['begin_time']) &&
myself()->_getNowTime() <= strtotime($meta['end_time'])) {
return $meta;
}
}
return null;
}
public static function getNowSeasonNum()
{
$i = 0;
foreach (self::getMetaList() as $meta) {
if (phpcommon\getNowTime() >= strtotime($meta['open_time']) &&
phpcommon\getNowTime() <= strtotime($meta['end_time'])) {
break;
}
++$i;
}
return $i;
}
protected static $itemArr;
protected static $metaList;
}