This commit is contained in:
hujiabin 2022-10-18 17:35:12 +08:00
parent 34c303d1a4
commit 1580cc814b
2 changed files with 18 additions and 6 deletions

View File

@ -133,6 +133,7 @@ class User(object):
], ],
'response': [ 'response': [
_common.RspHead(), _common.RspHead(),
['property_chg', _common.PropertyChg(), '属性变更'],
] ]
},{ },{
'name': 'selectFreeItem', 'name': 'selectFreeItem',

View File

@ -70,7 +70,7 @@ class UserController extends BaseAuthedController {
$userInfo = $this->_getOrmUserInfo(); $userInfo = $this->_getOrmUserInfo();
} }
} }
$this->updateLastSeason($userInfo);
$this->_rspData(array( $this->_rspData(array(
'info' => User::show($userInfo) 'info' => User::show($userInfo)
)); ));
@ -618,7 +618,11 @@ class UserController extends BaseAuthedController {
); );
User::update($fields); User::update($fields);
$this->_setV(TN_RANK_STATUS, 0, 0); $this->_setV(TN_RANK_STATUS, 0, 0);
$this->_rspOk(); $propertyChgService = new services\PropertyChgService();
$propertyChgService->addUserChg();
$this->_rspData([
'property_chg' => $propertyChgService->toDto(),
]);
} }
public function selectFreeItem(){ public function selectFreeItem(){
@ -679,10 +683,6 @@ class UserController extends BaseAuthedController {
private function createNewUserV2($userName){ private function createNewUserV2($userName){
$currSeasonMeta = mt\RankSeason::getCurrentSeason(); $currSeasonMeta = mt\RankSeason::getCurrentSeason();
// if (!$currSeasonMeta){
// $time = $this->_getNowTime() + (86400*10);
// $currSeasonMeta = mt\RankSeason::getSeasonByTime($time);
// }
SqlHelper::upsert SqlHelper::upsert
($this->_getSelfMysql(), ($this->_getSelfMysql(),
't_user', 't_user',
@ -710,4 +710,15 @@ class UserController extends BaseAuthedController {
); );
} }
private function updateLastSeason($userInfo){
if (! $userInfo['last_season_id']){
$currSeasonMeta = mt\RankSeason::getCurrentSeason();
if ($currSeasonMeta){
$this->_updateUserInfo(array(
'last_season_id'=>$currSeasonMeta['id'],
));
}
}
}
} }