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, '更新性别(可选参数,不传就不更新)'],
['head_id', 0, '更新头像(可选参数,不传就不更新)'],
['head_frame', 0, '更新头像框(可选参数,不传就不更新)'],
['hero_uniid', 0, '更新上阵英雄唯一id(可选参数,不传就不更新)'],
['hero_id', 0, '更新上阵英雄id(可选参数,不传就不更新)'],
['first_fight', 0, '更新首次战斗(可选参数,不传就不更新)']
],
'response': [

View File

@ -40,7 +40,6 @@ CREATE TABLE `t_user` (
`score` int(11) NOT NULL DEFAULT '0' COMMENT '积分',
`gold` 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',
`first_fight` int(11) NOT NULL DEFAULT '0' COMMENT '是否首战',
`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'];
//$avatar_url = $_REQUEST['avatar_url'];
$userName = '极乐玩家';
$userName = 'guest';
$avatarUrl = '18003';
$userInfo = $this->_safeGetOrmUserInfo();
@ -125,7 +125,7 @@ class UserController extends BaseAuthedController {
$headId = !empty($haveHeadHeroList) ?
$haveHeadHeroList[rand() % count($haveHeadHeroList)]['hero_head'] : 0;
}
Hero::randHero($heroUniId, $heroId);
//Hero::randHero($heroUniId, $heroId);
SqlHelper::upsert
($this->_getSelfMysql(),
't_user',
@ -148,7 +148,6 @@ class UserController extends BaseAuthedController {
'history_best_rank' => $initRankMeta ? $initRankMeta['rank'] : 1,
'score' => $initRankMeta ? $initRankMeta['min_score'] : 0,
'head_id' => $headId,
'hero_uniid' => $heroUniId,
'hero_id' => $heroId,
'last_season_id' => $currSeasonMeta ? $currSeasonMeta['id'] : 0,
'head_list' => json_encode($headList),
@ -240,7 +239,6 @@ class UserController extends BaseAuthedController {
public function update()
{
$userInfo = $this->_getOrmUserInfo();
$heroId = $userInfo['hero_id'];
$validFields = array(
'sex' => array(
'field_name' => 'sex',
@ -287,15 +285,13 @@ class UserController extends BaseAuthedController {
}
}
),
'hero_uniid' => array(
'field_name' => 'hero_uniid',
'hero_id' => array(
'field_name' => 'hero_id',
'val_func' => function ($val) {
return $val;
},
'valid_func' => function ($val, &$errCode, &$errMsg) use (&$heroId) {
$heroDb = Hero::find($val);
if ($heroDb) {
$heroId = $heroDb['hero_id'];
if (Hero::getValidHero($val)) {
return true;
} else {
$errCode = 1;

View File

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