Documentation
¶
Index ¶
- type Goods
- type Model
- type RebateMode
- type SysUser
- func (s *SysUser) BeforeInsert()
- func (s *SysUser) BeforeUpdate()
- func (s *SysUser) ChangePassword() ghttp.HandlerFunc
- func (s *SysUser) ChangePassword2() ghttp.HandlerFunc
- func (s *SysUser) CompoundIndexes() []*gxdb.CompoundIndex
- func (s *SysUser) GetByName(name string) (bean *SysUser, err error)
- func (s *SysUser) InitData() error
- func (s *SysUser) PlaintextPassword() (plaintext string, err error)
- func (s *SysUser) UseCache() bool
- type SysUserBalance
- type SysUserInfo
- type UserRole
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Goods ¶
type Goods struct { Model `xorm:"extends"` //4位商品随机码 RandCode string `json:"rand_code" xorm:"varchar(4) notnull comment('商品随机码')"` //商品的名字,可以重复,用ID区分不同商品 Name string `json:"name" xorm:"varchar(20) notnull"` //是否可用 Enable bool `json:"enable" xorm:"notnull comment('商品是否可用')"` //商品的额定售价 Price float64 `json:"price" xorm:"DECIMAL(19,5) notnull comment('商品的额定售价')"` //商品返佣占总售价的比例,n% //0=>不参与返佣,不能为负 Rate1 int `json:"rate_1" xorm:"notnull comment('商品返佣占总售价的百分比(n%)')"` //返佣分配的方式 //1.逐层平分(含购买者本人),关系链中的每一个人,将商品的返佣额进行均分 //2.阶梯均分,距离购买者最近的返佣金额最多 RMode RebateMode `json:"r_mode" xorm:"notnull comment('返佣分配的方式')"` //限制参与返佣的购买次数 //用户购买n次之内,关系链内的成员均参与返佣 //超过时,则不对关系链内的成员返佣 //0表示不限制次数 //单人购买返佣次数 Limit1 int `json:"limit_1" xorm:"notnull comment('单人购买返佣次数')"` }
Goods ...商品表
func (*Goods) CompoundIndexes ¶
func (g *Goods) CompoundIndexes() []*gxdb.CompoundIndex
CompoundIndexes implement InterfaceCompoundIndexes
type RebateMode ¶
type RebateMode int
RebateMode 返佣模式
const ( //均分 RModeEach RebateMode = iota + 1 //阶梯 比如2层,共分100,第一人分1x,第二人分2x RModeLadder )
declare rebate mode
type SysUser ¶
type SysUser struct { Model `xorm:"extends"` //手机号码注册 Username string `json:"username" xorm:"varchar(20) notnull unique"` Password string `json:"password,omitempty" xorm:"varchar(50) notnull"` //用户是否已被冻结,登录时,如果被冻结,提示 //不设置索引,需要查询出数据再进行单独判断 Enable bool `json:"enable" xorm:"notnull"` //用户身份,不会更改; 1->Master 2->Vip Role UserRole `json:"role" xorm:"notnull index comment('用户身份级别')"` }
SysUser 用户表 表名 sys_user
func (*SysUser) ChangePassword ¶
func (s *SysUser) ChangePassword() ghttp.HandlerFunc
ChangePassword ...修改密码 Deprecated ...use ChangePassword2
func (*SysUser) ChangePassword2 ¶
func (s *SysUser) ChangePassword2() ghttp.HandlerFunc
ChangePassword2 ...
func (*SysUser) CompoundIndexes ¶
func (s *SysUser) CompoundIndexes() []*gxdb.CompoundIndex
CompoundIndexes 实现联合索引接口
func (*SysUser) PlaintextPassword ¶
PlaintextPassword ...获取密码明文
type SysUserBalance ¶
type SysUserBalance struct { Model `xorm:"extends"` UID int64 `json:"uid" xorm:"notnull unique"` Amount float64 `json:"amount" xorm:"DECIMAL(19,5) notnull comment('余额')"` }
SysUserBalance 用户账户余额
func (*SysUserBalance) CompoundIndexes ¶
func (s *SysUserBalance) CompoundIndexes() []*gxdb.CompoundIndex
CompoundIndexes implement InterfaceCompoundIndexes
func (*SysUserBalance) UseCache ¶
func (s *SysUserBalance) UseCache() bool
UseCache implement InterfaceCompoundIndexes
type SysUserInfo ¶
type SysUserInfo struct { Model `xorm:"extends"` UID int64 `json:"uid" xorm:"notnull unique"` Nick string `json:"nick" xorm:"varchar(50) notnull"` Wx string `json:"wx,omitempty" xorm:"varchar(20) notnull"` //Phone string `json:"phone,omitempty" xorm:"varchar(15) notnull"` RegIP string `json:"reg_ip,omitempty" xorm:"varchar(20) notnull"` Comment string `json:"comment,omitempty" xorm:"varchar(100) notnull comment('用户备注')"` }
SysUserInfo 用户信息表
func (*SysUserInfo) CompoundIndexes ¶
func (s *SysUserInfo) CompoundIndexes() []*gxdb.CompoundIndex
CompoundIndexes implement InterfaceCompoundIndexes
func (*SysUserInfo) UseCache ¶
func (s *SysUserInfo) UseCache() bool
UseCache implement InterfaceCompoundIndexes
Click to show internal directories.
Click to hide internal directories.