From 92ebeb1cfce67086c5bd30e30c1cbe4ecc19ad20 Mon Sep 17 00:00:00 2001 From: hujiabin Date: Thu, 27 Oct 2022 14:36:21 +0800 Subject: [PATCH] 1 --- doc/User.py | 3 +++ webapp/controller/MissionController.class.php | 17 +++++------- webapp/controller/UserController.class.php | 27 +++++++++++++++++++ 3 files changed, 36 insertions(+), 11 deletions(-) diff --git a/doc/User.py b/doc/User.py index b01bf828..d257da97 100644 --- a/doc/User.py +++ b/doc/User.py @@ -74,6 +74,9 @@ class User(object): ['hero_id', 0, '更新上阵英雄id(可选参数,不传就不更新)'], ['first_fight', 0, '更新首次战斗(可选参数,不传就不更新)'], ['already_guide', 0, '已引导(可选参数,不传就不更新)'], + ['guild_id', 0, '跟新工会id(可选参数,不传就不更新)'], + ['guild_job', 0, '跟新工会职位(可选参数,不传就不更新)'], + ['guild_name', 0, '跟新工会名称(可选参数,不传就不更新)'], ], 'response': [ _common.RspHead(), diff --git a/webapp/controller/MissionController.class.php b/webapp/controller/MissionController.class.php index e8516586..04d0a42a 100644 --- a/webapp/controller/MissionController.class.php +++ b/webapp/controller/MissionController.class.php @@ -33,29 +33,24 @@ class MissionController extends BaseAuthedController { private $propertyChgService = null; private $userInfo = null; private $seasonService = null; - private $currSeasonMeta = null; + private $currRankSeasonMeta = null; private $seasonDb = null; public function _handlePre() { parent::_handlePre(); DynData::preload(); - $this->currSeasonMeta = mt\Season::getCurrentSeason(); - if (!$this->currSeasonMeta) { + $this->currRankSeasonMeta = mt\RankSeason::getCurrentSeason(); + if (!$this->currRankSeasonMeta) { $this->_rspErr(10, 'server internal error'); die(); } $this->propertyChgService = new services\PropertyChgService(); $this->userInfo = $this->_safeGetOrmUserInfo(); - $this->seasonService = new services\SeasonService(); - if (!$this->seasonService->checkSeason($this->userInfo)) { - $this->userInfo = $this->_safeGetOrmUserInfo(); - $this->propertyChgService->addUserChg(); - } - $this->seasonDb = Season::find($this->currSeasonMeta['id']); + $this->seasonDb = Season::find($this->currRankSeasonMeta['id']); if (!$this->seasonDb) { - Season::add($this->currSeasonMeta['id']); - $this->seasonDb = Season::find($this->currSeasonMeta['id']); + Season::add($this->currRankSeasonMeta['id']); + $this->seasonDb = Season::find($this->currRankSeasonMeta['id']); } if (!$this->seasonDb) { $this->_rspErr(10, 'server internal error'); diff --git a/webapp/controller/UserController.class.php b/webapp/controller/UserController.class.php index 14b7d6fe..7b25b2aa 100644 --- a/webapp/controller/UserController.class.php +++ b/webapp/controller/UserController.class.php @@ -477,6 +477,33 @@ class UserController extends BaseAuthedController { 'valid_func' => function ($val, &$errCode, &$errMsg) { return true; } + ), + 'guild_id' => array( + 'field_name' => 'guild_id', + 'val_func' => function ($val) { + return empty($val) ? '' : $val; + }, + 'valid_func' => function ($val, &$errCode, &$errMsg) { + return true; + } + ), + 'guild_job' => array( + 'field_name' => 'guild_job', + 'val_func' => function ($val) { + return empty($val) ? 0 : $val; + }, + 'valid_func' => function ($val, &$errCode, &$errMsg) { + return true; + } + ), + 'guild_name' => array( + 'field_name' => 'guild_name', + 'val_func' => function ($val) { + return empty($val) ? '' : $val; + }, + 'valid_func' => function ($val, &$errCode, &$errMsg) { + return true; + } ) ); $fieldsKv = array();