Documentation ¶
Index ¶
- Constants
- Variables
- func WithProductInfo(ctx echo.Context, list []*AgentAndProduct) error
- type AgentAndProduct
- type AgentLevel
- type AgentProduct
- func (f *AgentProduct) Add() (pk interface{}, err error)
- func (f *AgentProduct) DecrSold(id uint64, n uint) error
- func (f *AgentProduct) Edit(mw func(db.Result) db.Result, args ...interface{}) error
- func (f *AgentProduct) Exists(agentID uint64, productID string, productTable string) error
- func (f *AgentProduct) ExistsOther(agentID uint64, productID string, productTable string, id uint64) error
- func (f *AgentProduct) GetByProduct(agentID uint64, productID string, productTable string) (*dbschema.OfficialCustomerAgentProduct, error)
- func (f *AgentProduct) IncrSold(id uint64, n uint) error
- func (f *AgentProduct) SaveSold(agentID uint64, productID string, productTable string, performance float64) error
- type AgentProfile
- type AgentProfileExt
- type AgentRecv
Constants ¶
View Source
const ( ProfileStatusIdle = `idle` ProfileStatusPending = `pending` ProfileStatusPaid = `paid` ProfileStatusUnconfirm = `unconfirm` ProfileStatusSuccess = `success` ProfileStatusReject = `reject` ProfileStatusCheat = `cheat` ProfileStatusSignedContract = `signedContract` ProfileStatusUnsignedContract = `unsignedContract` )
Variables ¶
View Source
var ( Source = source.New() RecvMoneyMethod = echo.NewKVData(). Add(`alipay`, `支付宝`, echo.KVOptHKV(`online`, true)). Add(`wechat`, `微信`, echo.KVOptHKV(`online`, true)). Add(`icbc`, `工商银行`). Add(`abc`, `农业银行`). Add(`ccb`, `建设银行`). Add(`boc`, `中国银行`). Add(`cmb`, `招商银行`). Add(`comm`, `交通银行`) )
View Source
var ProfileStatus = echo.NewKVData(). Add(ProfileStatusIdle, `草稿`). Add(ProfileStatusPending, `待付款`, echo.KVOptHKV(`applyDescrition`, `如果付款后状态依然没有改变,请联系客服`)). Add(ProfileStatusUnconfirm, `未确认`, echo.KVOptHKV(`applyDescrition`, `正在等待管理员确认您的资料`)). Add(ProfileStatusPaid, `已付款`, echo.KVOptHKV(`color`, `primary`), echo.KVOptHKV(`applyDescrition`, `已经收到您的付款,请静待管理员确认`)). Add(ProfileStatusSuccess, `申请成功`, echo.KVOptHKV(`color`, `success`), echo.KVOptHKV(`applyDescrition`, `🎉恭喜您成为代理`)). Add(ProfileStatusReject, `拒绝`, echo.KVOptHKV(`color`, `danger`), echo.KVOptHKV(`applyDescrition`, `因资料不符合要求,已经驳回了您的申请,请修改资料后重新提交`)). Add(ProfileStatusCheat, `作弊封号`, echo.KVOptHKV(`color`, `warning`), echo.KVOptHKV(`applyDescrition`, `因存在违规行为,你的代理资格已冻结`)). Add(ProfileStatusUnsignedContract, `未签合约`, echo.KVOptHKV(`color`, `warning`), echo.KVOptHKV(`applyDescrition`, `请签好书面合同后寄回`)). Add(ProfileStatusSignedContract, `已签合约`, echo.KVOptHKV(`color`, `info`), echo.KVOptHKV(`applyDescrition`, `已经签订合同`))
ProfileStatus idle:空闲/草稿;pending:待付款;paid:已付款;unconfirm:未确认;success:申请成功;reject:拒绝;cheat:作弊封号;unsignedContract:未签合同;signedContract:已签合同
Functions ¶
func WithProductInfo ¶
func WithProductInfo(ctx echo.Context, list []*AgentAndProduct) error
Types ¶
type AgentAndProduct ¶
type AgentAndProduct struct { *dbschema.OfficialCustomerAgentProduct Product echo.KV `json:",omitempty" db:"-"` Agent *dbschema.OfficialCustomer `json:",omitempty" db:"-,relation=id:agent_id|gtZero"` }
type AgentLevel ¶
type AgentLevel struct {
*dbschema.OfficialCustomerAgentLevel
}
func NewAgentLevel ¶
func NewAgentLevel(ctx echo.Context) *AgentLevel
func (*AgentLevel) Add ¶
func (f *AgentLevel) Add() (pk interface{}, err error)
func (*AgentLevel) Exists ¶
func (f *AgentLevel) Exists(name string) error
func (*AgentLevel) ExistsOther ¶
func (f *AgentLevel) ExistsOther(name string, id uint) error
type AgentProduct ¶
type AgentProduct struct {
*dbschema.OfficialCustomerAgentProduct
}
func NewAgentProduct ¶
func NewAgentProduct(ctx echo.Context) *AgentProduct
func (*AgentProduct) Add ¶
func (f *AgentProduct) Add() (pk interface{}, err error)
func (*AgentProduct) Exists ¶
func (f *AgentProduct) Exists(agentID uint64, productID string, productTable string) error
func (*AgentProduct) ExistsOther ¶
func (*AgentProduct) GetByProduct ¶
func (f *AgentProduct) GetByProduct(agentID uint64, productID string, productTable string) (*dbschema.OfficialCustomerAgentProduct, error)
type AgentProfile ¶
type AgentProfile struct {
*dbschema.OfficialCustomerAgentProfile
}
func NewAgentProfile ¶
func NewAgentProfile(ctx echo.Context) *AgentProfile
func (*AgentProfile) Add ¶
func (f *AgentProfile) Add() (pk interface{}, err error)
func (*AgentProfile) ListPage ¶
func (f *AgentProfile) ListPage(cond *db.Compounds, orderby ...interface{}) ([]*AgentProfileExt, error)
type AgentProfileExt ¶
type AgentProfileExt struct { *dbschema.OfficialCustomerAgentProfile Recv *dbschema.OfficialCustomerAgentRecv `json:",omitempty" db:"-,relation=customer_id:customer_id"` Customer *dbschema.OfficialCustomer `json:",omitempty" db:"-,relation=id:customer_id"` Level *dbschema.OfficialCustomerAgentLevel `json:",omitempty" db:"-,relation=id:apply_level|gtZero"` }
Click to show internal directories.
Click to hide internal directories.