Documentation
¶
Index ¶
- Constants
- Variables
- func AddGroup(k string, v string)
- func LevelNew(ctx echo.Context, customerID uint64, group string, assetType string, ...) error
- func LevelUp(ctx echo.Context, f *dbschema.OfficialCustomerLevelRelation) error
- func MakeFreeCond(group string, balance float64, accumulated float64, asset string) *db.Compounds
- func MakePayCond(group string, balance float64, accumulated float64, asset string) *db.Compounds
- type Level
- func (f *Level) Add() (pk interface{}, err error)
- func (f *Level) CanAutoLevelUpBy(customerID uint64, group string, assetType string) (*dbschema.OfficialCustomerLevel, error)
- func (f *Level) CanAutoLevelUpByCustomerID(customerID uint64) (*dbschema.OfficialCustomerLevel, error)
- func (f *Level) CanAutoLevelUpByIntegral(balance float64, accumulated float64) (*dbschema.OfficialCustomerLevel, error)
- func (f *Level) CanAutoLevelUpByIntegralAsset(group string, balance float64, accumulated float64, asset string) (*dbschema.OfficialCustomerLevel, error)
- func (f *Level) CanPaymentLevelUpByIntegralAsset(group string, balance float64, accumulated 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) LevelUp() error
- 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` // 金额类型 AmountTypeBalance = `balance` AmountTypeAccumulated = `accumulated` )
Variables ¶
View Source
var AmountTypes = echo.NewKVData().Add(AmountTypeBalance, echo.T(`余额`)).Add(AmountTypeAccumulated, echo.T(`累积总收入`))
View Source
var GroupList = echo.NewKVData().Add(`base`, echo.T(`普通会员`))
GroupList base-普通会员(基础组),其它名称为扩展组。客户只能有一个基础组等级,可以有多个扩展组等级
View Source
var LevelStatuses = echo.NewKVData().Add(LevelStatusActived, echo.T(`有效`)).Add(LevelStatusExpired, echo.T(`过期`))
Functions ¶
func MakeFreeCond ¶
Types ¶
type Level ¶
type Level struct {
*dbschema.OfficialCustomerLevel
}
func (*Level) CanAutoLevelUpBy ¶
func (*Level) CanAutoLevelUpByCustomerID ¶
func (f *Level) CanAutoLevelUpByCustomerID(customerID uint64) (*dbschema.OfficialCustomerLevel, error)
func (*Level) CanAutoLevelUpByIntegral ¶
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.