Documentation ¶
Index ¶
- Constants
- Variables
- func AddGroup(k string, v string)
- type Level
- func (f *Level) Add() (pk interface{}, err error)
- func (f *Level) CanAutoLevelUpByCustomerID(customerID uint64) (*dbschema.OfficialCustomerLevel, error)
- func (f *Level) CanAutoLevelUpByIntegral(integral float64) (*dbschema.OfficialCustomerLevel, error)
- func (f *Level) CanAutoLevelUpByIntegralAsset(group string, integral float64, asset string) (*dbschema.OfficialCustomerLevel, error)
- func (f *Level) CanPaymentLevelUpByIntegralAsset(group string, integral float64, asset string) (*dbschema.OfficialCustomerLevel, error)
- func (f *Level) Edit(mw func(db.Result) db.Result, args ...interface{}) error
- func (f *Level) Exists(name string) error
- func (f *Level) ExistsOther(name string, id uint) error
- func (f *Level) GetMinLevelByGroup(group string) error
- func (f *Level) GreaterOrEqualThan(levelId uint, targetLevelId uint) (bool, error)
- func (f *Level) LessThan(levelId uint, targetLevelId uint) (bool, error)
- func (f *Level) ListByCustomer(customer *dbschema.OfficialCustomer) ([]*dbschema.OfficialCustomerLevel, error)
- func (f *Level) ListLevelGroup() ([]*LevelGroup, error)
- func (f *Level) Than(levelId uint, targetLevelId uint, ...) (bool, error)
- type LevelGroup
- type Relation
- func (f *Relation) GetGroupLevelByCustomerID(customerID uint64, group string) (*dbschema.OfficialCustomerLevel, error)
- func (f *Relation) HasGroupLevelByCustomerID(customerID uint64, group string) bool
- func (f *Relation) ListByCustomerID(customerID uint64) ([]*dbschema.OfficialCustomerLevelRelation, error)
- func (f *Relation) ListByCustomerIDs(customerIDs []uint64) (map[uint64][]*RelationExt, error)
- type RelationExt
Constants ¶
View Source
const ( LevelStatusActived = `actived` LevelStatusExpired = `expired` )
Variables ¶
View Source
var GroupList = echo.NewKVData().Add(`base`, `普通会员`)
GroupList base-普通会员(基础组),其它名称为扩展组。客户只能有一个基础组等级,可以有多个扩展组等级
View Source
var LevelStatuses = echo.NewKVData().Add(LevelStatusActived, `有效`).Add(LevelStatusExpired, `过期`)
Functions ¶
Types ¶
type Level ¶
type Level struct {
*dbschema.OfficialCustomerLevel
}
func (*Level) CanAutoLevelUpByCustomerID ¶
func (f *Level) CanAutoLevelUpByCustomerID(customerID uint64) (*dbschema.OfficialCustomerLevel, error)
func (*Level) CanAutoLevelUpByIntegral ¶
func (f *Level) CanAutoLevelUpByIntegral(integral float64) (*dbschema.OfficialCustomerLevel, error)
func (*Level) CanAutoLevelUpByIntegralAsset ¶
func (*Level) CanPaymentLevelUpByIntegralAsset ¶
func (*Level) GetMinLevelByGroup ¶
func (*Level) GreaterOrEqualThan ¶
func (*Level) ListByCustomer ¶
func (f *Level) ListByCustomer(customer *dbschema.OfficialCustomer) ([]*dbschema.OfficialCustomerLevel, error)
func (*Level) ListLevelGroup ¶
func (f *Level) ListLevelGroup() ([]*LevelGroup, error)
type LevelGroup ¶
type LevelGroup struct { Group string Title string List []*dbschema.OfficialCustomerLevel }
type Relation ¶
type Relation struct {
*dbschema.OfficialCustomerLevelRelation
}
客户的扩展组等级关联关系
func NewRelation ¶
func (*Relation) GetGroupLevelByCustomerID ¶
func (*Relation) HasGroupLevelByCustomerID ¶
func (*Relation) ListByCustomerID ¶
func (f *Relation) ListByCustomerID(customerID uint64) ([]*dbschema.OfficialCustomerLevelRelation, error)
func (*Relation) ListByCustomerIDs ¶
func (f *Relation) ListByCustomerIDs(customerIDs []uint64) (map[uint64][]*RelationExt, error)
type RelationExt ¶
type RelationExt struct { *dbschema.OfficialCustomerLevelRelation Level *dbschema.OfficialCustomerLevel `db:"-,relation=id:level_id|gtZero"` }
func (*RelationExt) Name_ ¶
func (r *RelationExt) Name_() string
Click to show internal directories.
Click to hide internal directories.