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

update default pass status

parent f47323ac
......@@ -151,7 +151,7 @@ func submitTask(c *gin.Context) {
// 没有initdata,sync模块处理状态
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 {
c.JSON(200, withError(constant.InternalError))
return
......@@ -183,7 +183,7 @@ func submitTask(c *gin.Context) {
if isPremium {
taskStatus = constant.TaskHistoryStatusSuccess
}
_, err = srv.SubmitTask(taskId, userId, task.Daily, taskStatus)
_, err = srv.SubmitTask(taskId, userId, task.Pass, task.Daily, taskStatus)
if err != nil {
c.JSON(200, withError(constant.InternalError))
return
......
......@@ -157,7 +157,11 @@ func (s *Service) GetTaskResult(isDailyTask bool, taskId int, userId string) (st
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)
if err != nil {
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