level

package
v0.1.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2023 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GroupList = []echo.KV{
	echo.KV{K: `base`, V: `基础组`},
}

GroupList base-基础组,其它名称为扩展组。客户只能有一个基础组等级,可以有多个扩展组等级

Functions

func AddGroup

func AddGroup(k string, v string)

Types

type Level

type Level struct {
	*dbschema.OfficialCustomerLevel
}

func NewLevel

func NewLevel(ctx echo.Context) *Level

func (*Level) Add

func (f *Level) Add() (pk interface{}, err error)

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) Edit

func (f *Level) Edit(mw func(db.Result) db.Result, args ...interface{}) error

func (*Level) Exists

func (f *Level) Exists(name string) error

func (*Level) ExistsOther

func (f *Level) ExistsOther(name string, id uint) error

func (*Level) GreaterOrEqualThan

func (f *Level) GreaterOrEqualThan(levelId uint, targetLevelId uint) (bool, error)

func (*Level) LessThan

func (f *Level) LessThan(levelId uint, targetLevelId uint) (bool, error)

func (*Level) ListByCustomer

func (f *Level) ListByCustomer(customer *dbschema.OfficialCustomer) ([]*dbschema.OfficialCustomerLevel, error)

func (*Level) ListLevelGroup

func (f *Level) ListLevelGroup() ([]*LevelGroup, error)

func (*Level) Than

func (f *Level) Than(
	levelId uint, targetLevelId uint,
	compare func(*dbschema.OfficialCustomerLevel, *dbschema.OfficialCustomerLevel) bool,
) (bool, error)

type LevelGroup

type LevelGroup struct {
	Group string
	Title string
	List  []*dbschema.OfficialCustomerLevel
}

type Relation

type Relation struct {
	*dbschema.OfficialCustomerLevelRelation
}

func NewRelation

func NewRelation(ctx echo.Context) *Relation

func (*Relation) ListByCustomerID

func (f *Relation) ListByCustomerID(customerID uint64) ([]*dbschema.OfficialCustomerLevelRelation, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL