1
This commit is contained in:
parent
6ade0c4307
commit
d1281dd941
@ -8,7 +8,7 @@ class Season {
|
|||||||
|
|
||||||
public static function get($id)
|
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()
|
protected static function getMetaList()
|
||||||
@ -19,89 +19,17 @@ class Season {
|
|||||||
return self::$metaList;
|
return self::$metaList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getSeasonRewardByLv($lv)
|
public static function getCurrentSeason()
|
||||||
{
|
|
||||||
$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()
|
|
||||||
{
|
{
|
||||||
foreach (self::getMetaList() as $meta) {
|
foreach (self::getMetaList() as $meta) {
|
||||||
if (phpcommon\getNowTime() >= strtotime($meta['open_time']) &&
|
if (myself()->_getNowTime() >= strtotime($meta['begin_time']) &&
|
||||||
phpcommon\getNowTime() <= strtotime($meta['end_time'])) {
|
myself()->_getNowTime() <= strtotime($meta['end_time'])) {
|
||||||
return $meta;
|
return $meta;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
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;
|
protected static $metaList;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user