|
|
@@ -0,0 +1,58 @@
|
|
|
+// Code generated by gorm.io/gen. DO NOT EDIT.
|
|
|
+// Code generated by gorm.io/gen. DO NOT EDIT.
|
|
|
+// Code generated by gorm.io/gen. DO NOT EDIT.
|
|
|
+
|
|
|
+package model
|
|
|
+
|
|
|
+import (
|
|
|
+ "go_zh/config"
|
|
|
+ "time"
|
|
|
+)
|
|
|
+
|
|
|
+const TableNameXMember = "x_members"
|
|
|
+
|
|
|
+// XMember mapped from table <x_members>
|
|
|
+type XMember struct {
|
|
|
+ ID int `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
|
|
|
+ Phone string `gorm:"column:phone;not null;comment:手机号码" json:"phone"` // 手机号码
|
|
|
+ Nickname string `gorm:"column:nickname;not null;default:振合网;comment:昵称" json:"nickname"` // 昵称
|
|
|
+ Password string `gorm:"column:password;not null;comment:登录密码" json:"password"` // 登录密码
|
|
|
+ PayPass string `gorm:"column:pay_pass;not null;comment:支付密码" json:"pay_pass"` // 支付密码
|
|
|
+ Encrypt string `gorm:"column:encrypt;not null;comment:加密字符串" json:"encrypt"` // 加密字符串
|
|
|
+ Status int `gorm:"column:status;not null;comment:状态,0:关闭,1:开启" json:"status"` // 状态,0:关闭,1:开启
|
|
|
+ CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
|
|
|
+ UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
|
|
|
+ RecomID int `gorm:"column:recom_id;not null;comment:推荐人ID" json:"recom_id"` // 推荐人ID
|
|
|
+ HeadImg string `gorm:"column:head_img;comment:头像" json:"head_img"` // 头像
|
|
|
+ InviteCode string `gorm:"column:invite_code;not null;comment:推荐码" json:"invite_code"` // 推荐码
|
|
|
+ LevelID int `gorm:"column:level_id;not null;comment:等级ID" json:"level_id"` // 等级ID
|
|
|
+ TokenStr string `gorm:"column:token_str;comment:token" json:"token_str"` // token
|
|
|
+ ConsumeMoney float64 `gorm:"column:consume_money;comment:消费金" json:"consume_money"` // 消费金
|
|
|
+ Money float64 `gorm:"column:money;comment:余额" json:"money"` // 余额
|
|
|
+ BenefitMoney float64 `gorm:"column:benefit_money;comment:公益豆" json:"benefit_money"` // 公益豆
|
|
|
+ ShareImg string `gorm:"column:share_img;comment:分享海报图片" json:"share_img"` // 分享海报图片
|
|
|
+ Sex int `gorm:"column:sex;comment:性别" json:"sex"` // 性别
|
|
|
+ CodeImg string `gorm:"column:code_img;comment:推荐码" json:"code_img"` // 推荐码
|
|
|
+ Describe string `gorm:"column:describe;comment:描述" json:"describe"` // 描述
|
|
|
+ Sid string `gorm:"column:sid;comment:长链接登陆编号" json:"sid"` // 长链接登陆编号
|
|
|
+ OnLine int `gorm:"column:on_line;comment:长链接在线" json:"on_line"` // 长链接在线
|
|
|
+ Source int `gorm:"column:source;default:1;comment:来源 1微信 2支付宝 3浏览器" json:"source"` // 来源 1微信 2支付宝 3浏览器
|
|
|
+ IsDel int `gorm:"column:is_del;comment:是否删除 0否 1是" json:"is_del"` // 是否删除 0否 1是
|
|
|
+ MergeSource string `gorm:"column:merge_source;comment:账户合并了那些来源账户" json:"merge_source"` // 账户合并了那些来源账户
|
|
|
+ BeanMoney float64 `gorm:"column:bean_money;comment:振合豆" json:"bean_money"` // 振合豆
|
|
|
+}
|
|
|
+
|
|
|
+// TableName XMember's table name
|
|
|
+func (*XMember) TableName() string {
|
|
|
+ return TableNameXMember
|
|
|
+}
|
|
|
+
|
|
|
+//根据token获取用户信息
|
|
|
+func (m *XMember) GetMemberByToken(token string) (*XMember, error) {
|
|
|
+ member := &XMember{}
|
|
|
+ model := config.Mdb.Model(member).Where("token_str = ?",token)
|
|
|
+ if err := model.First(member).Error; err != nil {
|
|
|
+ return member,err
|
|
|
+ }
|
|
|
+ return member, nil
|
|
|
+}
|