This commit is contained in:
aozhiwei 2024-11-15 16:03:22 +08:00
parent 68f6653cbf
commit 453132a6f4
2 changed files with 9 additions and 1 deletions

View File

@ -73,7 +73,7 @@ CREATE TABLE `t_user` (
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
UNIQUE KEY `uk_account_id` (`account_id`),
KEY (`openid`)
KEY (`openid`),
PRIMARY KEY (`idx`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

View File

@ -101,3 +101,11 @@ func (this *User) AddScore(score int32) error {
}
return nil
}
func (this *User) UpdateName() error {
if result := f5.GetApp().GetOrmDb(constant.WHEEL_DB).Model(this).Select(
"nickname").Updates(this); result.Error != nil {
return result.Error
}
return nil
}