$meta['id'], 'min' => $meta['min_point'], 'max' => $meta['max_point'], 'des' => $meta['des'], 'topoint' => $meta['topoint'], 'is_protect' => $meta['is_protect'], ); } public static function calcTopoint($userInfo) { $integral = 0; foreach (self::getMetaList() as $meta) { if ($userInfo['integral'] <= $meta['max_point'] || $meta['max_point'] == -1) { $integral = $meta['topoint']; break; } } return $integral; } public static function calcScore($integral, &$isProtect, &$minScore) { $isProtect = false; $minScore = 0; foreach (self::getMetaList() as $meta) { if ($integral >= $meta['min'] && $integral <= $meta['max'] || $integral >= $meta['min'] && $meta['max'] == -1) { $isProtect = $meta['is_protect']; $minScore = $meta['min']; } } } protected static function getMetaList() { if (!self::$metaList) { self::$metaList = getMetaTable('seasomPoint@seasomPoint.php'); } return self::$metaList; } protected static $metaList; }