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.
98 lines
5.8 KiB
98 lines
5.8 KiB
package model
|
|
|
|
import (
|
|
"time"
|
|
|
|
"pure/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:已结束
|
|
ClaimStock int64 `json:"claim_stock"` // 可接任务库存
|
|
Sample
|
|
VideoMaterial
|
|
ClaimDays int `gorm:"type:tinyint(11)" json:"claim_days"` // 任务完成天数
|
|
ClaimDemands string `gorm:"type:varchar(500);" json:"claim_demands"` // 任务拍摄要求
|
|
Description string `gorm:"type:varchar(2000);" json:"description"` // 描述/卖点
|
|
|
|
global.MG_MODEL
|
|
}
|
|
|
|
type MissionDetail struct {
|
|
Title string `json:"title"` // 标题
|
|
GoodsId uint `json:"-"`
|
|
GoodsStatus int `json:"goods_status"` // 关联商品状态 1:正常 2:已下架
|
|
Goods TbGoodsSpecsView `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:"type:int(11)" 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"` //订单数
|
|
Sample
|
|
|
|
VideoMaterial
|
|
ClaimStock int64 `json:"claim_stock"` // 可接任务库存
|
|
ClaimDays int `gorm:"type:tinyint(11)" json:"claim_days"` // 任务完成天数
|
|
ClaimDemands string `gorm:"type:varchar(500);" json:"claim_demands"` // 任务拍摄要求
|
|
Description string `gorm:"type:varchar(2000);" json:"description"` // 描述/卖点
|
|
ReleaseChannels string `gorm:"-" json:"release_channels"` // 发布渠道
|
|
ReleaseCountry string `gorm:"-" json:"release_country"` // 发布国家
|
|
ClaimStatusExcept string `json:"claim_status_except"` // 可接任务状态描述
|
|
ClaimStatusExceptEng string `json:"claim_status_except_eng"` // 英文版状态描述
|
|
GoodsUrl string `json:"goods_url"` // 商品链接
|
|
global.MG_MODEL
|
|
}
|
|
|
|
type Sample struct {
|
|
HasSample int `gorm:"type:tinyint(1);default:0" json:"has_sample"` // 是否有样品 0:没有 1:有
|
|
SampleNum int `gorm:"type:tinyint(11);" json:"sample_num"` // 样品数量
|
|
}
|
|
|
|
type VideoMaterial struct {
|
|
HasVideo int `gorm:"type:tinyint(1);default:0" json:"has_video"` // 是否有视频素材 0:没有 1:有
|
|
VideoUrl string `json:"video_url"`
|
|
VideoChannelIds string `json:"video_channel_ids"` // 视频发布渠道,多个渠道英文逗号连接
|
|
VideoCountryId string `json:"video_country_id"` // 视频发布国家
|
|
}
|
|
|
|
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"`
|
|
UserTotal float64 `json:"user_total"`
|
|
}
|
|
|
|
func (Mission) TableName() string {
|
|
return "mission"
|
|
}
|
|
|
|
func (MissionDetail) TableName() string {
|
|
return "mission"
|
|
}
|
|
|