|
@@ -179,7 +179,7 @@ func BindWxUser(openid,mobile,email string) (wxUser *models.WxUserItem,err error
|
|
|
var userId int
|
|
|
//如果查询出来的用户是nil,那么需要新增用户
|
|
|
if wxUser == nil{
|
|
|
- user := &models.WxUser{
|
|
|
+ wxUser := &models.WxUser{
|
|
|
CompanyId:1,
|
|
|
CreatedTime:time.Now(),
|
|
|
FirstLogin:1,
|
|
@@ -189,12 +189,12 @@ func BindWxUser(openid,mobile,email string) (wxUser *models.WxUserItem,err error
|
|
|
Mobile: mobile,
|
|
|
Email: email,
|
|
|
}
|
|
|
- tmpUserId, addUserErr := models.AddWxUser(user)
|
|
|
+ tmpUserId, addUserErr := models.AddWxUser(wxUser)
|
|
|
if err != nil{
|
|
|
err = addUserErr
|
|
|
return
|
|
|
}
|
|
|
- user.UserId = int(tmpUserId)
|
|
|
+ wxUser.UserId = int(tmpUserId)
|
|
|
userId = int(tmpUserId)
|
|
|
}else{
|
|
|
userId = wxUser.UserId
|
|
@@ -328,7 +328,6 @@ func AddUserRecord(openId,unionId,nickName,realName,province,city,country,headim
|
|
|
if find != nil{
|
|
|
userRecord = find
|
|
|
return
|
|
|
-
|
|
|
}
|
|
|
userRecord = &models.UserRecord{
|
|
|
OpenId :openId, //用户open_id
|