1.修复修改GetUserById导致报错问题,新增GetSysUserById;

This commit is contained in:
chenlin 2024-07-24 15:04:40 +08:00
parent 7e21a88722
commit b50abd884b
2 changed files with 9 additions and 2 deletions

View File

@ -350,7 +350,7 @@ func UpdateSysUser(c *gin.Context) {
tools.HasError(err, "数据解析失败", 500)
}
sysInfo := models.GetUserById(uint32(req.UserId))
sysInfo := models.GetSysUserById(uint32(req.UserId))
if sysInfo.Uid != 0 {
// 添加店员兑换码
var shopperCode models.ShopperPromotionCode

View File

@ -636,7 +636,14 @@ func (e *SysUser) SetPwd(pwd SysUserPwd) (Result bool, err error) {
return
}
func GetUserById(id uint32) *SysUser {
func GetUserById(id uint32) *SysUserB {
var u = new(SysUserB)
orm.Eloquent.Table("sys_user").Where("user_id", id).First(u)
return u
}
func GetSysUserById(id uint32) *SysUser {
var u = new(SysUser)
orm.Eloquent.Table("sys_user").Where("user_id", id).First(u)