|
@@ -107,6 +107,8 @@ func (this *WechatCommonController) WechatLoginByGzh() {
|
|
|
items.Country = wxUserInfo.Country
|
|
|
items.Headimgurl = wxUserInfo.Headimgurl
|
|
|
items.CreateTime = time.Now()
|
|
|
+ items.Subscribe = 1
|
|
|
+ items.SubscribeTime = time.Now()
|
|
|
if user != nil {
|
|
|
items.CygxUserId = user.UserId
|
|
|
items.CygxBindAccount = user.Mobile
|
|
@@ -119,6 +121,25 @@ func (this *WechatCommonController) WechatLoginByGzh() {
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
+ userRecord := &models.UserRecord{
|
|
|
+ OpenId: openId,
|
|
|
+ UnionId: unionId,
|
|
|
+ Subscribe: 0,
|
|
|
+ NickName: wxUserInfo.Nickname,
|
|
|
+ RealName: "",
|
|
|
+ Sex: wxUserInfo.Sex,
|
|
|
+ Province: wxUserInfo.Province,
|
|
|
+ City: wxUserInfo.City,
|
|
|
+ Country: wxUserInfo.Country,
|
|
|
+ Headimgurl: wxUserInfo.Headimgurl,
|
|
|
+ CreateTime: time.Now(),
|
|
|
+ CreatePlatform: 12,
|
|
|
+ SessionKey: wxUserInfo.SessionKey,
|
|
|
+ }
|
|
|
+ _, err = models.AddUserRecord(userRecord)
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
timeUnix := time.Now().Unix()
|
|
|
timeUnixStr := strconv.FormatInt(timeUnix, 10)
|
|
|
|