1
This commit is contained in:
parent
c2d1bf9ae2
commit
92ebeb1cfc
@ -74,6 +74,9 @@ class User(object):
|
|||||||
['hero_id', 0, '更新上阵英雄id(可选参数,不传就不更新)'],
|
['hero_id', 0, '更新上阵英雄id(可选参数,不传就不更新)'],
|
||||||
['first_fight', 0, '更新首次战斗(可选参数,不传就不更新)'],
|
['first_fight', 0, '更新首次战斗(可选参数,不传就不更新)'],
|
||||||
['already_guide', 0, '已引导(可选参数,不传就不更新)'],
|
['already_guide', 0, '已引导(可选参数,不传就不更新)'],
|
||||||
|
['guild_id', 0, '跟新工会id(可选参数,不传就不更新)'],
|
||||||
|
['guild_job', 0, '跟新工会职位(可选参数,不传就不更新)'],
|
||||||
|
['guild_name', 0, '跟新工会名称(可选参数,不传就不更新)'],
|
||||||
],
|
],
|
||||||
'response': [
|
'response': [
|
||||||
_common.RspHead(),
|
_common.RspHead(),
|
||||||
|
@ -33,29 +33,24 @@ class MissionController extends BaseAuthedController {
|
|||||||
private $propertyChgService = null;
|
private $propertyChgService = null;
|
||||||
private $userInfo = null;
|
private $userInfo = null;
|
||||||
private $seasonService = null;
|
private $seasonService = null;
|
||||||
private $currSeasonMeta = null;
|
private $currRankSeasonMeta = null;
|
||||||
private $seasonDb = null;
|
private $seasonDb = null;
|
||||||
|
|
||||||
public function _handlePre()
|
public function _handlePre()
|
||||||
{
|
{
|
||||||
parent::_handlePre();
|
parent::_handlePre();
|
||||||
DynData::preload();
|
DynData::preload();
|
||||||
$this->currSeasonMeta = mt\Season::getCurrentSeason();
|
$this->currRankSeasonMeta = mt\RankSeason::getCurrentSeason();
|
||||||
if (!$this->currSeasonMeta) {
|
if (!$this->currRankSeasonMeta) {
|
||||||
$this->_rspErr(10, 'server internal error');
|
$this->_rspErr(10, 'server internal error');
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
$this->propertyChgService = new services\PropertyChgService();
|
$this->propertyChgService = new services\PropertyChgService();
|
||||||
$this->userInfo = $this->_safeGetOrmUserInfo();
|
$this->userInfo = $this->_safeGetOrmUserInfo();
|
||||||
$this->seasonService = new services\SeasonService();
|
$this->seasonDb = Season::find($this->currRankSeasonMeta['id']);
|
||||||
if (!$this->seasonService->checkSeason($this->userInfo)) {
|
|
||||||
$this->userInfo = $this->_safeGetOrmUserInfo();
|
|
||||||
$this->propertyChgService->addUserChg();
|
|
||||||
}
|
|
||||||
$this->seasonDb = Season::find($this->currSeasonMeta['id']);
|
|
||||||
if (!$this->seasonDb) {
|
if (!$this->seasonDb) {
|
||||||
Season::add($this->currSeasonMeta['id']);
|
Season::add($this->currRankSeasonMeta['id']);
|
||||||
$this->seasonDb = Season::find($this->currSeasonMeta['id']);
|
$this->seasonDb = Season::find($this->currRankSeasonMeta['id']);
|
||||||
}
|
}
|
||||||
if (!$this->seasonDb) {
|
if (!$this->seasonDb) {
|
||||||
$this->_rspErr(10, 'server internal error');
|
$this->_rspErr(10, 'server internal error');
|
||||||
|
@ -477,6 +477,33 @@ class UserController extends BaseAuthedController {
|
|||||||
'valid_func' => function ($val, &$errCode, &$errMsg) {
|
'valid_func' => function ($val, &$errCode, &$errMsg) {
|
||||||
return true;
|
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();
|
$fieldsKv = array();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user