作者 陈志颖

feat:个人任务统计增加已过期任务

... ... @@ -24,6 +24,7 @@ const (
TASK_STATUS_COMPLETED //已完成
TASK_STATUS_CLOSED //关闭
TASK_STATUS_UNCONFIRMED //待确认
TASK_STATUS_EXPIRED //已过期
)
// 任务
... ...
... ... @@ -288,8 +288,18 @@ func (dao *TaskDao) CalculatePersonTask(uid int64) (map[string]interface{}, erro
} else {
completedAsParticipator = int64(count)
}
//if count, err := tx.Model(taskModel).
// Where(`task.sponsor @> '{}'`)
// TODO 已过期竞标任务统计
if count, err := tx.Model(taskModel).
Where(`task.sponsor @> '{"uid":?}'`, uid).
//Where(`task.task_type = ? `, domain.TASK_STATUS_EXPIRED).
Where(`task.task_type = ?`, 2).
Where("task.task_status = ? ", domain.TASK_STATUS_UNCLAIMED).
Where(`task.planned_completion_time < ?`, time.Now()).
Count(); err != nil {
return nil, err
} else {
expiredAsSponsor = int64(count)
}
return map[string]interface{}{
"underwayAsAssignedPerson": underwayAsAssignedPerson,
"unAcceptanceAsAssignedPerson": unAcceptanceAsAssignedPerson,
... ...