You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
3.9 KiB
66 lines
3.9 KiB
6 months ago
|
package model
|
||
|
|
||
|
import (
|
||
|
"time"
|
||
|
|
||
|
"shop-api/global"
|
||
|
)
|
||
|
|
||
|
type Mission struct { // 任务
|
||
|
Title string `gorm:"type:mediumtext" json:"title"` // 标题
|
||
|
GoodsId uint `gorm:"type:int(11)" json:"goods_id"` // 关联商品
|
||
|
GoodsStatus int `gorm:"type:tinyint(1);" json:"goods_status"` // 关联商品状态 1:正常 2:已下架
|
||
|
Num int64 `gorm:"type:int(11)" json:"num"` // 商品数量
|
||
|
HireType int `gorm:"type:tinyint(1)" json:"hire_type"` // 佣金类型 1:固定佣金 2:比例抽成
|
||
|
HireMoney float64 `gorm:"type:decimal(10,2);" json:"hire_money"` // hire_type==1 佣金金额
|
||
|
HireRatio float64 `gorm:"type:decimal(10,2);" json:"hire_ratio"` // hire_type==2 抽成比例
|
||
|
StartTime *time.Time `gorm:"column:start_time" json:"start_time"` // 任务起始时间
|
||
|
EndTime *time.Time `gorm:"column:end_time" json:"end_time"` // 任务结束时间
|
||
|
ClaimNum int64 `gorm:"type:int(11)" json:"claim_num"` // 接任务人数
|
||
|
CollectionNum int64 `gorm:"type:int(11)" json:"collection_num"` // 收藏人数
|
||
|
CreateBy string `gorm:"size:64" json:"create_by"` // 创建人
|
||
|
Status int `gorm:"type:tinyint(1);" json:"status"` // 状态 1:未开始 2:进行中 3:已结束
|
||
|
global.MG_MODEL
|
||
|
}
|
||
|
|
||
|
type MissionDetail struct {
|
||
|
Title string `json:"title"` // 标题
|
||
|
GoodsId uint `json:"-"`
|
||
|
GoodsStatus int `json:"goods_status"` // 关联商品状态 1:正常 2:已下架
|
||
|
Goods TbGoodsView `gorm:"ForeignKey:GoodsId;AssociationForeignKey:ID" json:"goods"` // 商品信息
|
||
|
Num int64 `json:"num"` // 商品数量
|
||
|
HireType int `json:"hire_type"` // 佣金类型 1:固定佣金 2:比例抽成
|
||
|
HireMoney float64 `json:"hire_money"` // hire_type==1 佣金金额
|
||
|
HireRatio float64 `json:"hire_ratio"` // hire_type==2 抽成比例
|
||
|
HireMoneyExpect string `json:"hire_money_expect"` // 预计佣金描述
|
||
|
StartTime *time.Time `json:"start_time"` // 任务起始时间
|
||
|
EndTime *time.Time `json:"end_time"` // 任务结束时间
|
||
|
ClaimNum int64 `gorm:"-" json:"claim_num"` // 接任务人数
|
||
|
CreateBy string `json:"-"` //
|
||
|
CollectStatus bool `gorm:"-" json:"collect_status"` // 收藏状态 true:已收藏 false:未收藏
|
||
|
Store SellerStoreInfo `gorm:"-" json:"store"` // 商家信息
|
||
|
Status int `json:"status"` // 状态 1:未开始 2:进行中 3:已结束
|
||
|
// OrderNum int64 `gorm:"-" json:"order_num"` //订单数
|
||
|
global.MG_MODEL
|
||
|
}
|
||
|
|
||
|
type MissionClaimInfo struct {
|
||
|
MissionId uint `json:"mission_id"` // 任务id
|
||
|
ClaimNo string `json:"claim_no"` // 领取任务编号
|
||
|
HireType int `gorm:"type:tinyint(1)" json:"hire_type"` // 佣金类型 1:固定佣金 2:比例抽成
|
||
|
HireMoney float64 `gorm:"type:decimal(10,2);" json:"hire_money"` // hire_type==1 佣金金额
|
||
|
HireRatio float64 `gorm:"type:decimal(10,2);" json:"hire_ratio"` // hire_type==2 抽成比例
|
||
|
}
|
||
|
|
||
|
type MissionBonus struct {
|
||
|
Total float64 `json:"total"`
|
||
|
}
|
||
|
|
||
|
func (Mission) TableName() string {
|
||
|
return "mission"
|
||
|
}
|
||
|
|
||
|
func (MissionDetail) TableName() string {
|
||
|
return "mission"
|
||
|
}
|