job limit
This commit is contained in:
@@ -147,3 +147,10 @@ func GetJobDetail(db *DaoDB, jobID int) (job *GetJobsResult, err error) {
|
||||
job.JobSteps = jobSteps
|
||||
return job, err
|
||||
}
|
||||
|
||||
func GetJobOrders(db *DaoDB, jobID int, userID string, status int) (jobOrders []*model.JobOrder, err error) {
|
||||
// sql := `
|
||||
// SELECT
|
||||
// `
|
||||
return jobOrders, err
|
||||
}
|
||||
@@ -3,9 +3,15 @@ package model
|
||||
import "time"
|
||||
|
||||
const (
|
||||
JobStatusDoing = 0
|
||||
JobStatusFinished = 1
|
||||
JobStatusFailed = -1
|
||||
JobStatusDoing = 0 //正在进行中
|
||||
JobStatusFinished = 1 //任务所有都被完成
|
||||
JobStatusFailed = -1 //任务发布失败
|
||||
JobStatusOverdue = -2 //任务过期
|
||||
|
||||
JobLimitCountTypePO = 1 //每人一次
|
||||
JobLimitCountTypePDO = 2 //每人每天一次
|
||||
JobLimitCountTypePWO = 3 //每人每周一次
|
||||
JobLimitCountTypeNoLimie = 4 //不限制
|
||||
|
||||
JobOrderStatusAccept = 5
|
||||
JobOrderStatusWaitAudit = 10
|
||||
@@ -18,22 +24,26 @@ const (
|
||||
type Job struct {
|
||||
ModelIDCULD
|
||||
|
||||
UserID string `orm:"column(user_id)" json:"thingID"` //发布人ID
|
||||
JobCategoryID int `orm:"column(job_category_id)" json:"jobCategoryID"` //任务类型
|
||||
JobSpan string `orm:"size(500)" json:"jobSpan"` //任务标签
|
||||
Title string `orm:"size(255)" json:"title"` //任务标题
|
||||
Content string `orm:"size(500)" json:"content"` //任务内容
|
||||
Count int `json:"count"` //任务数量
|
||||
AvgPrice int `json:"avgPrice"` //单个任务金额
|
||||
TotalPrice int `json:"totalPrice"` //任务总金额
|
||||
Status int `json:"status"` //任务状态
|
||||
Address string `orm:"size(500)" json:"address"` //任务地址
|
||||
Lng int `json:"lng"` //乘了10的6次方
|
||||
Lat int `json:"lat"` //乘了10的6次方
|
||||
FinishedAt time.Time `json:"finishedAt"` //截止日期
|
||||
StoreURL string `orm:"column(store_url)" json:"storeURL"` //门店链接
|
||||
SkuURL string `orm:"column(sku_url)" json:"skuURL"` //商品优惠券链接
|
||||
JobSteps []*JobStep `orm:"-" json:"jobSteps"`
|
||||
UserID string `orm:"column(user_id)" json:"thingID"` //发布人ID
|
||||
JobCategoryID int `orm:"column(job_category_id)" json:"jobCategoryID"` //任务类型
|
||||
JobSpan string `orm:"size(500)" json:"jobSpan"` //任务标签
|
||||
Title string `orm:"size(255)" json:"title"` //任务标题
|
||||
Content string `orm:"size(500)" json:"content"` //任务内容
|
||||
Count int `json:"count"` //任务数量
|
||||
SurplusCount int `json:"surplusCount"` //剩余数量
|
||||
AvgPrice int `json:"avgPrice"` //单个任务金额
|
||||
TotalPrice int `json:"totalPrice"` //任务总金额
|
||||
Status int `json:"status"` //任务状态
|
||||
Address string `orm:"size(500)" json:"address"` //任务地址
|
||||
Lng int `json:"lng"` //乘了10的6次方
|
||||
Lat int `json:"lat"` //乘了10的6次方
|
||||
JobLimitAt int `json:"jobLimitAt"` //任务限时完成小时数
|
||||
AuditLimitAt int `json:"auditLimitAt"` //任务审核限时小时数
|
||||
FinishedAt time.Time `json:"finishedAt"` //接单截止日期
|
||||
LimitCountType int `json:"limitCountType"` //任务限次类型,1为每人一次,2为每人每天一次,3为每人每周一次,4为不限制
|
||||
StoreURL string `orm:"column(store_url)" json:"storeURL"` //门店链接
|
||||
SkuURL string `orm:"column(sku_url)" json:"skuURL"` //商品优惠券链接
|
||||
JobSteps []*JobStep `orm:"-" json:"jobSteps"`
|
||||
}
|
||||
|
||||
func (v *Job) TableIndex() [][]string {
|
||||
@@ -63,6 +73,7 @@ type JobStep struct {
|
||||
StepCount int `json:"stepCount"` //步骤数
|
||||
Content string `orm:"size(500)" json:"content"` //步骤内容
|
||||
Img string `orm:"size(500)" json:"img"` //步骤图片
|
||||
Type int `json:"type"` //步骤类型,1为任务步骤,2为收集信息
|
||||
}
|
||||
|
||||
func (v *JobStep) TableIndex() [][]string {
|
||||
@@ -74,13 +85,13 @@ func (v *JobStep) TableIndex() [][]string {
|
||||
type JobOrder struct {
|
||||
ModelIDCUL
|
||||
|
||||
JobID int `orm:"column(job_id)" json:"jobID"` //任务ID
|
||||
UserID string `orm:"column(user_id)" json:"thingID"` //接任务人ID
|
||||
Status int `json:"status"` //任务订单状态,接单,待审核,已审核,已结算等
|
||||
SubmitAuditAt time.Time `json:"submitAuditTime"` //提交审核日期
|
||||
AuditAt time.Time `json:"auditAt"` //审核日期
|
||||
Content string `josn:"content"` //任务审核内容
|
||||
Img string `json:"img"` //任务审核图片
|
||||
JobID int `orm:"column(job_id)" json:"jobID"` //任务ID
|
||||
UserID string `orm:"column(user_id)" json:"userID"` //接任务人ID
|
||||
Status int `json:"status"` //任务订单状态,接单,待审核,已审核,已结算等
|
||||
SubmitAuditAt time.Time `json:"submitAuditTime"` //提交审核日期
|
||||
AuditAt time.Time `json:"auditAt"` //审核日期
|
||||
Content string `josn:"content"` //任务审核内容
|
||||
Img string `json:"img"` //任务审核图片
|
||||
}
|
||||
|
||||
func (v *JobOrder) TableIndex() [][]string {
|
||||
|
||||
Reference in New Issue
Block a user