Merge branch 'xjjdev'

This commit is contained in:
徐俊杰 2023-03-31 13:52:59 +08:00
commit db6e137598
2 changed files with 2 additions and 2 deletions

View File

@ -171,7 +171,7 @@ func (a *ArtistInfoUserProvider) BindInviteInvitedAccount(ctx context.Context, i
// 查询被邀请人是否存在
var invitedUser model.User
if in.InvitedUserId == 0 {
if err = db.DB.Debug().Where("invited_code = ? OR id = ?", in.InviteCode, in.InvitedUserId).First(&invitedUser).Error; err != nil {
if err = db.DB.Debug().Where("invited_code = ? OR id = ?", in.InvitedCode, in.InvitedUserId).First(&invitedUser).Error; err != nil {
if err == gorm.ErrRecordNotFound {
return nil, errors.New("被邀请人不存在")
} else {

View File

@ -39,7 +39,7 @@ func Init(confPath string) {
LoadMysqlData(file)
//MySQL数据库
path := strings.Join([]string{DbUser, ":", DbPassWord, "@tcp(", DbHost, ":", DbPort, ")/", DbLogName, "?charset=utf8&parseTime=true"}, "")
path := strings.Join([]string{DbUser, ":", DbPassWord, "@tcp(", DbHost, ":", DbPort, ")/", DbLogName, "?charset=utf8&parseTime=true&loc=Asia/Shanghai"}, "")
//连接数据库
Database(path)
//迁移表 如果需要就打开使用