fix wxpayment and login
This commit is contained in:
@@ -2,6 +2,7 @@ package query
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
@@ -1401,13 +1402,13 @@ func (l *QueryServiceLogic) GetOrCreateUser(mobile string) (int64, error) {
|
||||
return userID, nil
|
||||
}
|
||||
|
||||
userModel, err := l.svcCtx.UserModel.FindOneByMobile(l.ctx, mobile)
|
||||
userModel, err := l.svcCtx.UserModel.FindOneByMobile(l.ctx, sql.NullString{String: mobile, Valid: true})
|
||||
if err != nil && !errors.Is(err, model.ErrNotFound) {
|
||||
return 0, err
|
||||
}
|
||||
// 没有则创建账号
|
||||
if userModel == nil {
|
||||
userModel = &model.User{Mobile: mobile}
|
||||
userModel = &model.User{Mobile: sql.NullString{String: mobile, Valid: true}}
|
||||
// if len(userModel.Nickname) == 0 {
|
||||
// userModel.Nickname = mobile
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user