remove t_user.hero_unnid

This commit is contained in:
aozhiwei 2022-01-12 14:56:31 +08:00
parent 00a6566084
commit 0715e8b168
4 changed files with 6 additions and 13 deletions

View File

@ -62,7 +62,7 @@ class User(object):
['sex', 0, '更新性别(可选参数,不传就不更新)'], ['sex', 0, '更新性别(可选参数,不传就不更新)'],
['head_id', 0, '更新头像(可选参数,不传就不更新)'], ['head_id', 0, '更新头像(可选参数,不传就不更新)'],
['head_frame', 0, '更新头像框(可选参数,不传就不更新)'], ['head_frame', 0, '更新头像框(可选参数,不传就不更新)'],
['hero_uniid', 0, '更新上阵英雄唯一id(可选参数,不传就不更新)'], ['hero_id', 0, '更新上阵英雄id(可选参数,不传就不更新)'],
['first_fight', 0, '更新首次战斗(可选参数,不传就不更新)'] ['first_fight', 0, '更新首次战斗(可选参数,不传就不更新)']
], ],
'response': [ 'response': [

View File

@ -40,7 +40,6 @@ CREATE TABLE `t_user` (
`score` int(11) NOT NULL DEFAULT '0' COMMENT '积分', `score` int(11) NOT NULL DEFAULT '0' COMMENT '积分',
`gold` int(11) NOT NULL DEFAULT '0' COMMENT '金币', `gold` int(11) NOT NULL DEFAULT '0' COMMENT '金币',
`diamond` int(11) NOT NULL DEFAULT '0' COMMENT '钻石', `diamond` int(11) NOT NULL DEFAULT '0' COMMENT '钻石',
`hero_uniid` int(11) NOT NULL DEFAULT '0' COMMENT '当前上阵英雄唯一id',
`hero_id` int(11) NOT NULL DEFAULT '0' COMMENT '当前上阵英雄id', `hero_id` int(11) NOT NULL DEFAULT '0' COMMENT '当前上阵英雄id',
`first_fight` int(11) NOT NULL DEFAULT '0' COMMENT '是否首战', `first_fight` int(11) NOT NULL DEFAULT '0' COMMENT '是否首战',
`last_season_id` int(11) NOT NULL DEFAULT '0' COMMENT '最后一次赛季id', `last_season_id` int(11) NOT NULL DEFAULT '0' COMMENT '最后一次赛季id',

View File

@ -26,7 +26,7 @@ class UserController extends BaseAuthedController {
{ {
//$user_name = $_REQUEST['name']; //$user_name = $_REQUEST['name'];
//$avatar_url = $_REQUEST['avatar_url']; //$avatar_url = $_REQUEST['avatar_url'];
$userName = '极乐玩家'; $userName = 'guest';
$avatarUrl = '18003'; $avatarUrl = '18003';
$userInfo = $this->_safeGetOrmUserInfo(); $userInfo = $this->_safeGetOrmUserInfo();
@ -125,7 +125,7 @@ class UserController extends BaseAuthedController {
$headId = !empty($haveHeadHeroList) ? $headId = !empty($haveHeadHeroList) ?
$haveHeadHeroList[rand() % count($haveHeadHeroList)]['hero_head'] : 0; $haveHeadHeroList[rand() % count($haveHeadHeroList)]['hero_head'] : 0;
} }
Hero::randHero($heroUniId, $heroId); //Hero::randHero($heroUniId, $heroId);
SqlHelper::upsert SqlHelper::upsert
($this->_getSelfMysql(), ($this->_getSelfMysql(),
't_user', 't_user',
@ -148,7 +148,6 @@ class UserController extends BaseAuthedController {
'history_best_rank' => $initRankMeta ? $initRankMeta['rank'] : 1, 'history_best_rank' => $initRankMeta ? $initRankMeta['rank'] : 1,
'score' => $initRankMeta ? $initRankMeta['min_score'] : 0, 'score' => $initRankMeta ? $initRankMeta['min_score'] : 0,
'head_id' => $headId, 'head_id' => $headId,
'hero_uniid' => $heroUniId,
'hero_id' => $heroId, 'hero_id' => $heroId,
'last_season_id' => $currSeasonMeta ? $currSeasonMeta['id'] : 0, 'last_season_id' => $currSeasonMeta ? $currSeasonMeta['id'] : 0,
'head_list' => json_encode($headList), 'head_list' => json_encode($headList),
@ -240,7 +239,6 @@ class UserController extends BaseAuthedController {
public function update() public function update()
{ {
$userInfo = $this->_getOrmUserInfo(); $userInfo = $this->_getOrmUserInfo();
$heroId = $userInfo['hero_id'];
$validFields = array( $validFields = array(
'sex' => array( 'sex' => array(
'field_name' => 'sex', 'field_name' => 'sex',
@ -287,15 +285,13 @@ class UserController extends BaseAuthedController {
} }
} }
), ),
'hero_uniid' => array( 'hero_id' => array(
'field_name' => 'hero_uniid', 'field_name' => 'hero_id',
'val_func' => function ($val) { 'val_func' => function ($val) {
return $val; return $val;
}, },
'valid_func' => function ($val, &$errCode, &$errMsg) use (&$heroId) { 'valid_func' => function ($val, &$errCode, &$errMsg) use (&$heroId) {
$heroDb = Hero::find($val); if (Hero::getValidHero($val)) {
if ($heroDb) {
$heroId = $heroDb['hero_id'];
return true; return true;
} else { } else {
$errCode = 1; $errCode = 1;

View File

@ -38,7 +38,6 @@ class User extends BaseModel {
'score' => $row['score'], 'score' => $row['score'],
'gold' => $row['gold'], 'gold' => $row['gold'],
'diamond' => $row['diamond'], 'diamond' => $row['diamond'],
'hero_uniid' => $row['hero_uniid'],
'hero_id' => $row['hero_id'], 'hero_id' => $row['hero_id'],
'first_fight' => $row['first_fight'], 'first_fight' => $row['first_fight'],
'head_list' => self::getHeadList($row), 'head_list' => self::getHeadList($row),
@ -63,7 +62,6 @@ class User extends BaseModel {
'score' => $row['score'], 'score' => $row['score'],
'gold' => $row['gold'], 'gold' => $row['gold'],
'diamond' => $row['diamond'], 'diamond' => $row['diamond'],
'hero_uniid' => $row['hero_uniid'],
'hero_id' => $row['hero_id'], 'hero_id' => $row['hero_id'],
'first_fight' => $row['first_fight'], 'first_fight' => $row['first_fight'],
'head_list' => self::getHeadList($row), 'head_list' => self::getHeadList($row),