12345678910111213141516171819202122232425262728293031 |
- package models
- import (
- "rdluck_tools/orm"
- "time"
- )
- type WxUserCode struct {
- Id int `orm:"column(id);pk"`
- WxCode string
- UserId int
- Code int
- FirstLogin int
- Authorization string
- UserPermission int
- CreateTime time.Time
- }
- func AddWxUserCode(item *WxUserCode) (lastId int64, err error) {
- o := orm.NewOrm()
- lastId, err = o.Insert(item)
- return
- }
- func GetWxUserCode(wxCode string)(item *WxUserCode,err error) {
- o := orm.NewOrm()
- sql:=`SELECT * FROM wx_user_code WHERE wx_code=? `
- err=o.Raw(sql,wxCode).QueryRow(&item)
- return
- }
|