Commit d3961464 authored by 贾浩@五瓣科技's avatar 贾浩@五瓣科技

update default pass status

parent f47323ac
...@@ -151,7 +151,7 @@ func submitTask(c *gin.Context) { ...@@ -151,7 +151,7 @@ func submitTask(c *gin.Context) {
// 没有initdata,sync模块处理状态 // 没有initdata,sync模块处理状态
if initData == "" { if initData == "" {
_, err = srv.SubmitTask(taskId, userId, task.Daily, constant.TaskHistoryStatusPending) _, err = srv.SubmitTask(taskId, userId, task.Pass, task.Daily, constant.TaskHistoryStatusPending)
if err != nil { if err != nil {
c.JSON(200, withError(constant.InternalError)) c.JSON(200, withError(constant.InternalError))
return return
...@@ -183,7 +183,7 @@ func submitTask(c *gin.Context) { ...@@ -183,7 +183,7 @@ func submitTask(c *gin.Context) {
if isPremium { if isPremium {
taskStatus = constant.TaskHistoryStatusSuccess taskStatus = constant.TaskHistoryStatusSuccess
} }
_, err = srv.SubmitTask(taskId, userId, task.Daily, taskStatus) _, err = srv.SubmitTask(taskId, userId, task.Pass, task.Daily, taskStatus)
if err != nil { if err != nil {
c.JSON(200, withError(constant.InternalError)) c.JSON(200, withError(constant.InternalError))
return return
......
...@@ -157,7 +157,11 @@ func (s *Service) GetTaskResult(isDailyTask bool, taskId int, userId string) (st ...@@ -157,7 +157,11 @@ func (s *Service) GetTaskResult(isDailyTask bool, taskId int, userId string) (st
return return
} }
func (s *Service) SubmitTask(taskId int, userId string, isDailyTask bool, status string) (exist bool, err error) { func (s *Service) SubmitTask(taskId int, userId string, passTask, isDailyTask bool, status string) (exist bool, err error) {
if passTask {
status = constant.TaskHistoryStatusSuccess
}
exist, err = s.d.CreateTaskHistory(taskId, userId, isDailyTask, status) exist, err = s.d.CreateTaskHistory(taskId, userId, isDailyTask, status)
if err != nil { if err != nil {
log.WithError(err).Error("create task history error") log.WithError(err).Error("create task history error")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment