This commit is contained in:
苏尹岚
2020-12-10 10:26:09 +08:00
parent 9e07b0b957
commit caf63a3869
2 changed files with 15 additions and 1 deletions

View File

@@ -62,11 +62,21 @@ func PublishJob(ctx *jxcontext.Context, jobExt *model.JobExt) (errCode string, e
switch job.JobCategoryID {
case model.JobCategoryIDwmtg:
if job.Address == "" {
return errCode, fmt.Errorf("外卖推广任务请输入门店信息")
return errCode, fmt.Errorf("外卖推广任务请输入门店地址")
}
default:
return errCode, fmt.Errorf("暂不支持的任务类型! %v", job.JobCategoryID)
}
// 需根据返现类型做一些参数判断
switch job.CashbackType {
case model.JobCashbackPercentage:
if job.Percentage <= 0 || job.Percentage > 10 {
return errCode, fmt.Errorf("返现比例请输入1-10之间的比例")
}
case model.JobCashbackPrice:
default:
return errCode, fmt.Errorf("暂不支持的返现类型! %v", job.CashbackType)
}
if job.UserID == "" {
return errCode, fmt.Errorf("参数有误!")
}

View File

@@ -26,6 +26,8 @@ var (
BillTypeJobCancelOverdue: "任务过期或取消",
BillTypeJobAuditUnPassWithCancelOverdue: "任务不通过时,任务已取消或过期",
BillTypeSpJob: "特殊任务扣除",
BillTypeDivide: "群员做任务分成",
BillTypeJobDivide: "做任务实得(被扣除分成后)",
BillTypeMember: "开通会员",
BillTypeQuitGroup: "退群",
BillTypeJdWaybillOverWeight: "京东物流超重扣款",
@@ -39,6 +41,7 @@ type BillIncome struct {
ModelIDCUL
BillID int64 `orm:"column(bill_id)" json:"billID"` //账单ID
JobID int `orm:"column(job_id)" json:"jobID"` //任务ID
Type int `json:"type"` //收入类型
IncomePrice int `json:"incomePrice"` //收入金额
}
@@ -55,6 +58,7 @@ type BillExpend struct {
ModelIDCUL
BillID int64 `orm:"column(bill_id)" json:"billID"` //账单ID
JobID int `orm:"column(job_id)" json:"jobID"` //任务ID
Type int `json:"type"` //支出类型
ExpendPrice int `json:"expendPrice"` //支出金额
}