From 57282adc92b0698712bb034b1f5c20c0c7d3ab5f Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 22 Nov 2021 11:08:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90getSeasonPoint=E6=94=B9?= =?UTF-8?q?=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webapp/controller/FriendController.class.php | 16 ++------- webapp/controller/HangController.class.php | 16 +-------- webapp/controller/PassController.class.php | 16 +-------- webapp/controller/RankController.class.php | 20 +++-------- webapp/controller/RoleController.class.php | 16 +-------- webapp/controller/SignController.class.php | 16 +-------- webapp/mt/SeasonPoint.php | 37 ++++++++++++++++++++ 7 files changed, 48 insertions(+), 89 deletions(-) create mode 100644 webapp/mt/SeasonPoint.php diff --git a/webapp/controller/FriendController.class.php b/webapp/controller/FriendController.class.php index fbb6884..17e1ee9 100644 --- a/webapp/controller/FriendController.class.php +++ b/webapp/controller/FriendController.class.php @@ -2,7 +2,10 @@ require 'classes/Quest.php'; require 'classes/AddReward.php'; + require_once 'metatable/parameter.php'; +require_once('mt/SeasonPoint.php'); + class FriendController extends BaseAuthedController { @@ -23,19 +26,6 @@ class FriendController extends BaseAuthedController { return $conns; } - protected function getSeasonPoint($seaPoint_id) - { - $seaPoint_meta_table = require('../res/seasomPoint@seasomPoint.php'); - $seaPoint_meta = getSeasonPointConfig($seaPoint_meta_table, $seaPoint_id); - $seaPoint = array( - 'id' => $seaPoint_meta['id'], - 'min' => $seaPoint_meta['min_point'], - 'max' => $seaPoint_meta['max_point'], - 'des' => $seaPoint_meta['des'], - ); - return $seaPoint; - } - public function selectUserInfo() { $target_id = $_REQUEST['target_id']; diff --git a/webapp/controller/HangController.class.php b/webapp/controller/HangController.class.php index 4a02ef5..a024742 100644 --- a/webapp/controller/HangController.class.php +++ b/webapp/controller/HangController.class.php @@ -7,6 +7,7 @@ require_once 'metatable/drop.php'; require 'classes/AddReward.php'; require_once('mt/Parameter.php'); +require_once('mt/SeasonPoint.php'); class HangController extends BaseAuthedController { @@ -25,21 +26,6 @@ class HangController extends BaseAuthedController { } - protected function getSeasonPoint($seaPoint_id) - { - $seaPoint_meta_table = require('../res/seasomPoint@seasomPoint.php'); - $seaPoint_meta = getSeasonPointConfig($seaPoint_meta_table, $seaPoint_id); - $seaPoint = array( - 'id' => $seaPoint_meta['id'], - 'min' => $seaPoint_meta['min_point'], - 'max' => $seaPoint_meta['max_point'], - 'des' => $seaPoint_meta['des'], - //'reward' => $seaPoint_meta['season_reward'], - //'weekreward' => $seaPoint_meta['week_reward'], - ); - return $seaPoint; - } - public function getTime() { $account_id = $_REQUEST['account_id']; diff --git a/webapp/controller/PassController.class.php b/webapp/controller/PassController.class.php index 51066de..80e10d1 100644 --- a/webapp/controller/PassController.class.php +++ b/webapp/controller/PassController.class.php @@ -7,6 +7,7 @@ require_once 'metatable/season.php'; require_once 'metatable/seasoncard.php'; require_once('mt/Season.php'); +require_once('mt/SeasonPoint.php'); class PassController extends BaseAuthedController { @@ -24,21 +25,6 @@ class PassController extends BaseAuthedController { return $arr; } - protected function getSeasonPoint($seaPoint_id) - { - $seaPoint_meta_table = require('../res/seasomPoint@seasomPoint.php'); - $seaPoint_meta = getSeasonPointConfig($seaPoint_meta_table, $seaPoint_id); - $seaPoint = array( - 'id' => $seaPoint_meta['id'], - 'min' => $seaPoint_meta['min_point'], - 'max' => $seaPoint_meta['max_point'], - 'des' => $seaPoint_meta['des'], - //'reward' => $seaPoint_meta['season_reward'], - //'weekreward' => $seaPoint_meta['week_reward'], - ); - return $seaPoint; - } - public function getPassInfo() { $account_id = $_REQUEST['account_id']; diff --git a/webapp/controller/RankController.class.php b/webapp/controller/RankController.class.php index 12f3ad8..fd4c855 100644 --- a/webapp/controller/RankController.class.php +++ b/webapp/controller/RankController.class.php @@ -1,23 +1,11 @@ $seaPoint_meta['id'], - 'min' => $seaPoint_meta['min_point'], - 'max' => $seaPoint_meta['max_point'], - 'des' => $seaPoint_meta['des'], - ); - return $seaPoint; - } - - public function rankInfo() { $account_id = $_REQUEST['account_id']; diff --git a/webapp/controller/RoleController.class.php b/webapp/controller/RoleController.class.php index af97d05..99496d6 100644 --- a/webapp/controller/RoleController.class.php +++ b/webapp/controller/RoleController.class.php @@ -8,6 +8,7 @@ require_once('mt/Parameter.php'); require_once('mt/Drop.php'); require_once('mt/EquipUpgrade.php'); require_once('mt/Season.php'); +require_once('mt/SeasonPoint.php'); class RoleController extends BaseAuthedController { @@ -24,21 +25,6 @@ class RoleController extends BaseAuthedController { return $arr; } - protected function getSeasonPoint($seaPoint_id) - { - $seaPoint_meta_table = require('../res/seasomPoint@seasomPoint.php'); - $seaPoint_meta = getSeasonPointConfig($seaPoint_meta_table, $seaPoint_id); - $seaPoint = array( - 'id' => $seaPoint_meta['id'], - 'min' => $seaPoint_meta['min_point'], - 'max' => $seaPoint_meta['max_point'], - 'des' => $seaPoint_meta['des'], - 'topoint' => $seaPoint_meta['topoint'], - 'is_protect' => $seaPoint_meta['is_protect'], - ); - return $seaPoint; - } - protected function getRankReward($rank) { $rank_meta_table = require('../res/rankReward@rankReward.php'); diff --git a/webapp/controller/SignController.class.php b/webapp/controller/SignController.class.php index 408e2a1..2797558 100644 --- a/webapp/controller/SignController.class.php +++ b/webapp/controller/SignController.class.php @@ -5,6 +5,7 @@ require 'classes/AddReward.php'; require_once('mt/Parameter.php'); require_once('mt/Season.php'); +require_once('mt/SeasonPoint.php'); class SignController extends BaseAuthedController { @@ -64,21 +65,6 @@ class SignController extends BaseAuthedController { return $sh; } - protected function getSeasonPoint($seaPoint_id) - { - $seaPoint_meta_table = require('../res/seasomPoint@seasomPoint.php'); - $seaPoint_meta = getSeasonPointConfig($seaPoint_meta_table, $seaPoint_id); - $seaPoint = array( - 'id' => $seaPoint_meta['id'], - 'min' => $seaPoint_meta['min_point'], - 'max' => $seaPoint_meta['max_point'], - 'des' => $seaPoint_meta['des'], - 'topoint' => $seaPoint_meta['topoint'], - //'weekreward' => $seaPoint_meta['week_reward'], - ); - return $seaPoint; - } - protected function insertSign($account_id, $sign_days) { $conn = $this->getMysql($account_id); diff --git a/webapp/mt/SeasonPoint.php b/webapp/mt/SeasonPoint.php new file mode 100644 index 0000000..81be273 --- /dev/null +++ b/webapp/mt/SeasonPoint.php @@ -0,0 +1,37 @@ + $meta['id'], + 'min' => $meta['min_point'], + 'max' => $meta['max_point'], + 'des' => $meta['des'], + 'topoint' => $meta['topoint'], + 'is_protect' => $meta['is_protect'], + ); + } + + protected static function getMetaList() + { + if (!self::$metaList) { + self::$metaList = getMetaTable('seasomPoint@seasomPoint.php'); + } + return self::$metaList; + } + + protected static $metaList; + +}