wechat.go 650 B

12345678910111213141516171819202122232425
  1. package models
  2. import "github.com/beego/beego/v2/client/orm"
  3. type WechatSign struct {
  4. AppId string
  5. NonceStr string
  6. Timestamp int64
  7. Url string
  8. Signature string
  9. RawString string
  10. }
  11. type WxTicket struct {
  12. Errcode int `json:"errcode"`
  13. Errmsg string `json:"errmsg"`
  14. Ticket string `json:"ticket"`
  15. }
  16. func ModifyWxUserInfo(nickName, headimgUrl, city, province, country string, sex, userId int) (err error) {
  17. o := orm.NewOrm()
  18. sql := `UPDATE wx_user SET nick_name=?,headimgurl=?,sex=?,city=?,province=?,country=? WHERE user_id=? `
  19. _, err = o.Raw(sql, nickName, headimgUrl, sex, city, province, country, userId).Exec()
  20. return
  21. }