aa
This commit is contained in:
@@ -61,12 +61,23 @@ func PublishJob(ctx *jxcontext.Context, jobExt *model.JobExt) (errCode string, e
|
|||||||
finishedAt = utils.Str2Time(jobExt.FinishedAtStr)
|
finishedAt = utils.Str2Time(jobExt.FinishedAtStr)
|
||||||
job.FinishedAt = &finishedAt
|
job.FinishedAt = &finishedAt
|
||||||
// 需根据任务类型做一些参数判断,比如门店商品链接,地址
|
// 需根据任务类型做一些参数判断,比如门店商品链接,地址
|
||||||
|
if job.AvgPrice == 0 {
|
||||||
|
return errCode, fmt.Errorf("请输入单个任务奖励(保证)金额!")
|
||||||
|
}
|
||||||
switch job.JobCategoryID {
|
switch job.JobCategoryID {
|
||||||
case model.JobCategoryIDwmtg:
|
case model.JobCategoryIDwmtg:
|
||||||
if job.Address == "" {
|
if job.Address == "" {
|
||||||
return errCode, fmt.Errorf("外卖推广任务请输入门店地址!")
|
return errCode, fmt.Errorf("外卖推广任务请输入门店地址!")
|
||||||
}
|
}
|
||||||
case model.JobCategoryIDOther:
|
case model.JobCategoryIDOther:
|
||||||
|
case model.JobCategoryIDDropShipping:
|
||||||
|
if job.DropShippingAt == 0 {
|
||||||
|
return errCode, fmt.Errorf("一件代发任务请输入承诺x天内发货!")
|
||||||
|
}
|
||||||
|
if job.DropShippingSkuPrice == 0 {
|
||||||
|
return errCode, fmt.Errorf("一件代发任务请输入商品价格!")
|
||||||
|
}
|
||||||
|
job.CashbackType = model.JobCashbackPrice
|
||||||
default:
|
default:
|
||||||
return errCode, fmt.Errorf("暂不支持的任务类型! %v", job.JobCategoryID)
|
return errCode, fmt.Errorf("暂不支持的任务类型! %v", job.JobCategoryID)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,6 +73,13 @@ func GetJobs(db *DaoDB, userIDs []string, categoryIDs, statuss, vendorIDs, types
|
|||||||
WHERE a.deleted_at = ?
|
WHERE a.deleted_at = ?
|
||||||
AND (a.job_city_code = ? OR a.job_city_code = ?)
|
AND (a.job_city_code = ? OR a.job_city_code = ?)
|
||||||
`
|
`
|
||||||
|
if cityCode == 0 {
|
||||||
|
if len(cityCodes) > 0 {
|
||||||
|
cityCode = cityCodes[0]
|
||||||
|
} else {
|
||||||
|
cityCode = 510100
|
||||||
|
}
|
||||||
|
}
|
||||||
sqlParams = append(sqlParams, lng, lat, utils.DefaultTimeValue, utils.DefaultTimeValue, cityCode, model.JobCountrywideCode)
|
sqlParams = append(sqlParams, lng, lat, utils.DefaultTimeValue, utils.DefaultTimeValue, cityCode, model.JobCountrywideCode)
|
||||||
if len(userIDs) > 0 {
|
if len(userIDs) > 0 {
|
||||||
sql += ` AND a.user_id IN (` + GenQuestionMarks(len(userIDs)) + `)`
|
sql += ` AND a.user_id IN (` + GenQuestionMarks(len(userIDs)) + `)`
|
||||||
|
|||||||
@@ -34,8 +34,9 @@ const (
|
|||||||
JobCashbackPrice = 1 //返现类型固定返现
|
JobCashbackPrice = 1 //返现类型固定返现
|
||||||
JobCashbackPercentage = 2 //返现类型比例返现
|
JobCashbackPercentage = 2 //返现类型比例返现
|
||||||
|
|
||||||
JobCategoryIDwmtg = 3 //任务类型外卖推广
|
JobCategoryIDwmtg = 3 //任务类型外卖推广
|
||||||
JobCategoryIDOther = 4 //其他任务类型
|
JobCategoryIDOther = 4 //其他任务类型
|
||||||
|
JobCategoryIDDropShipping = 5 //一件代发
|
||||||
|
|
||||||
JobSpanTop = 1 //置顶
|
JobSpanTop = 1 //置顶
|
||||||
JobSpanRecommend = 2 //推荐
|
JobSpanRecommend = 2 //推荐
|
||||||
@@ -73,38 +74,40 @@ var (
|
|||||||
type Job struct {
|
type Job struct {
|
||||||
ModelIDCULD
|
ModelIDCULD
|
||||||
|
|
||||||
UserID string `orm:"column(user_id)" json:"userID"` //发布人ID
|
UserID string `orm:"column(user_id)" json:"userID"` //发布人ID
|
||||||
JobCategoryID int `orm:"column(job_category_id)" json:"jobCategoryID"` //任务类型
|
JobCategoryID int `orm:"column(job_category_id)" json:"jobCategoryID"` //任务类型
|
||||||
JobSpanTop int `json:"jobSpanTop"` //置顶标签
|
JobSpanTop int `json:"jobSpanTop"` //置顶标签
|
||||||
TopSeq int `json:"topSeq"` //置顶顺序
|
TopSeq int `json:"topSeq"` //置顶顺序
|
||||||
JobSpanRecmd int `json:"jobSpanRecmd"` //推荐标签
|
JobSpanRecmd int `json:"jobSpanRecmd"` //推荐标签
|
||||||
RecmdSeq int `json:"recmdSeq"` //推荐顺序
|
RecmdSeq int `json:"recmdSeq"` //推荐顺序
|
||||||
Title string `orm:"size(255)" json:"title"` //任务标题
|
Title string `orm:"size(255)" json:"title"` //任务标题
|
||||||
Content string `orm:"size(500)" json:"content"` //任务内容
|
Content string `orm:"size(500)" json:"content"` //任务内容
|
||||||
Count int `json:"count"` //任务数量
|
Count int `json:"count"` //任务数量
|
||||||
SurplusCount int `json:"surplusCount"` //剩余数量
|
SurplusCount int `json:"surplusCount"` //剩余数量
|
||||||
AvgPrice int `json:"avgPrice"` //单个任务金额或预估金额
|
AvgPrice int `json:"avgPrice"` //单个任务金额或预估金额
|
||||||
Percentage int `json:"percentage"` //如果是比例返现,返现比例
|
DropShippingSkuPrice int `json:"dropShippingSkuPrice"` //一件代发任务商品价格
|
||||||
CashbackType int `json:"cashbackType"` //返现方式,1为固定返现,2为比例返现
|
Percentage int `json:"percentage"` //如果是比例返现,返现比例
|
||||||
TotalPrice int `json:"totalPrice"` //任务总金额
|
CashbackType int `json:"cashbackType"` //返现方式,1为固定返现,2为比例返现
|
||||||
Status int `json:"status"` //任务状态
|
TotalPrice int `json:"totalPrice"` //任务总金额
|
||||||
Address string `orm:"size(500)" json:"address"` //门店地址
|
Status int `json:"status"` //任务状态
|
||||||
Lng int `json:"lng"` //乘了10的6次方
|
Address string `orm:"size(500)" json:"address"` //门店地址
|
||||||
Lat int `json:"lat"` //乘了10的6次方
|
Lng int `json:"lng"` //乘了10的6次方
|
||||||
JobLng float64 `json:"jobLng"` //任务发布地址
|
Lat int `json:"lat"` //乘了10的6次方
|
||||||
JobLat float64 `json:"jobLat"` //任务发布地址
|
JobLng float64 `json:"jobLng"` //任务发布地址
|
||||||
JobCityCode int `json:"jobCityCode"` //任务所属城市,999代表全国
|
JobLat float64 `json:"jobLat"` //任务发布地址
|
||||||
JobLimitAt int `json:"jobLimitAt"` //任务限时完成小时数
|
JobCityCode int `json:"jobCityCode"` //任务所属城市,999代表全国
|
||||||
AuditLimitAt int `json:"auditLimitAt"` //任务审核限时小时数
|
DropShippingAt int `json:"dropShippingAt"` //承诺一件代发几天内发货,小时数
|
||||||
FinishedAt *time.Time `orm:"null" json:"finishedAt"` //接单截止日期
|
JobLimitAt int `json:"jobLimitAt"` //任务限时完成小时数
|
||||||
LimitCountType int `json:"limitCountType"` //任务限次类型,1为每人一次,2为每人每天一次,3为每人每周一次,4为不限制
|
AuditLimitAt int `json:"auditLimitAt"` //任务审核限时小时数
|
||||||
VendorID int `orm:"column(vendor_id)" json:"vendorID"` //推广平台
|
FinishedAt *time.Time `orm:"null" json:"finishedAt"` //接单截止日期
|
||||||
StoreURL string `orm:"column(store_url)" json:"storeURL"` //门店链接
|
LimitCountType int `json:"limitCountType"` //任务限次类型,1为每人一次,2为每人每天一次,3为每人每周一次,4为不限制
|
||||||
SkuURL string `orm:"column(sku_url)" json:"skuURL"` //商品优惠券链接
|
VendorID int `orm:"column(vendor_id)" json:"vendorID"` //推广平台
|
||||||
Type int `json:"type"` //任务类型,0为普通任务,1为特殊任务
|
StoreURL string `orm:"column(store_url)" json:"storeURL"` //门店链接
|
||||||
BrowseCount int `json:"browseCount"` //任务浏览量,点一下加一下
|
SkuURL string `orm:"column(sku_url)" json:"skuURL"` //商品优惠券链接
|
||||||
JobSteps []*JobStep `orm:"-" json:"jobSteps"`
|
Type int `json:"type"` //任务类型,0为普通任务,1为特殊任务
|
||||||
JobImgs []*JobImg `orm:"-" json:"jobImgs"`
|
BrowseCount int `json:"browseCount"` //任务浏览量,点一下加一下
|
||||||
|
JobSteps []*JobStep `orm:"-" json:"jobSteps"`
|
||||||
|
JobImgs []*JobImg `orm:"-" json:"jobImgs"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (v *Job) TableIndex() [][]string {
|
func (v *Job) TableIndex() [][]string {
|
||||||
|
|||||||
Reference in New Issue
Block a user