|
|
|
@@ -27,7 +27,7 @@ func BindWechatOpenId(userId int64, wechatOpenId string) error { |
|
|
|
return err |
|
|
|
} |
|
|
|
|
|
|
|
param := &User{WechatOpenId: wechatOpenId} |
|
|
|
param := &User{WechatOpenId: wechatOpenId, WechatBindTime: time.Now()} |
|
|
|
n, err := sess.Where("ID = ?", userId).Update(param) |
|
|
|
if err != nil { |
|
|
|
log.Error("update wechat_open_id failed,e=%v", err) |
|
|
|
@@ -66,7 +66,7 @@ func UnbindWechatOpenId(userId int64, oldWechatOpenID string) error { |
|
|
|
return err |
|
|
|
} |
|
|
|
|
|
|
|
n, err := x.Table(new(User)).Where("ID = ? AND wechat_open_id =?", userId, oldWechatOpenID).Update(map[string]interface{}{"wechat_open_id": ""}) |
|
|
|
n, err := x.Table(new(User)).Where("ID = ? AND wechat_open_id =?", userId, oldWechatOpenID).Update(map[string]interface{}{"wechat_open_id": "", "wechat_bind_time": nil}) |
|
|
|
if err != nil { |
|
|
|
log.Error("update wechat_open_id failed,e=%v", err) |
|
|
|
return err |
|
|
|
|