diff --git a/business/jxstore/cms/cms.go b/business/jxstore/cms/cms.go index 85c46a8aa..933b22b88 100644 --- a/business/jxstore/cms/cms.go +++ b/business/jxstore/cms/cms.go @@ -93,6 +93,7 @@ func InitServiceInfo(version string, buildTime time.Time, gitCommit string) { }]`, "billTypeNames": model.BillTypeNames, "deliveryStatusName": model.DeliveryStatusName, + "cashbackName": model.CashbackName, }, } } diff --git a/business/jxstore/cms/job.go b/business/jxstore/cms/job.go index 3a8ed2f36..c36af677a 100644 --- a/business/jxstore/cms/job.go +++ b/business/jxstore/cms/job.go @@ -53,10 +53,13 @@ func PublishJob(ctx *jxcontext.Context, jobExt *model.JobExt) (errCode string, e finishedAt time.Time DayTimeBegin, DayTimeEnd = jxutils.GetDayTime() ) - //需根据任务类型做一些参数判断,比如门店商品链接,地址 - // switch job.JobCategoryID { - // case 1: - // } + // 需根据任务类型做一些参数判断,比如门店商品链接,地址 + switch job.JobCategoryID { + case model.JobCategoryIDwmtg: + + default: + return errCode, fmt.Errorf("暂不支持的任务类型! %v", job.JobCategoryID) + } if data, err := json.Marshal(jobExt); err == nil { json.Unmarshal(data, &job) } diff --git a/business/model/job.go b/business/model/job.go index 9bf779ac2..aeb10b5bd 100644 --- a/business/model/job.go +++ b/business/model/job.go @@ -30,6 +30,11 @@ const ( JobTypeNormal = 0 //普通任务 JobTypeMtMember = 1 //美团会员任务 JobTypeJdDelivery = 2 //京东快递任务 + + JobCashbackPrice = 1 //返现类型固定返现 + JobCashbackPercentage = 2 //返现类型比例返现 + + JobCategoryIDwmtg = 3 //任务类型外卖推广 ) var ( @@ -39,6 +44,11 @@ var ( OrderStatusFinished: "已妥投", OrderStatusCanceled: "已取消", } + + CashbackName = map[int]string{ + JobCashbackPrice: "固定返现", + JobCashbackPercentage: "比例返现", + } ) type Job struct { @@ -51,7 +61,9 @@ type Job struct { Content string `orm:"size(500)" json:"content"` //任务内容 Count int `json:"count"` //任务数量 SurplusCount int `json:"surplusCount"` //剩余数量 - AvgPrice int `json:"avgPrice"` //单个任务金额 + AvgPrice int `json:"avgPrice"` //单个任务金额或预估金额 + Percentage int `json:"percentage"` //如果是比例返现,返现比例 + CashbackType int `json:"cashbackType"` //返现方式,1为固定返现,2为比例返现 TotalPrice int `json:"totalPrice"` //任务总金额 Status int `json:"status"` //任务状态 Address string `orm:"size(500)" json:"address"` //任务地址