Skip to content

Commit

Permalink
fix update search result status
Browse files Browse the repository at this point in the history
  • Loading branch information
madneal committed Feb 15, 2025
1 parent 466be3c commit fdcedf5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions server/api/search_result.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,12 @@ func StartAITask(c *gin.Context) {
global.GVA_LOG.Info(content)
global.GVA_LOG.Info(ans)
if strings.ToLower(ans) == "yes" {
service.UpdateSearchResultById(int(result.ID), 1)
err = service.UpdateSearchResultById(int(result.ID), 1)
} else {
service.UpdateSearchResultById(int(result.ID), 2)
err = service.UpdateSearchResultById(int(result.ID), 2)
}
if err != nil {
global.GVA_LOG.Error("UpdateSearchResultByIds error", zap.Any("err", err))
}
}
}()
Expand Down
3 changes: 2 additions & 1 deletion server/service/search_result.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ func UpdateSearchResult(updateReq request.UpdateReq) (err error) {
}

func UpdateSearchResultById(id, status int) (err error) {
err = global.GVA_DB.UpdateColumn("status", status).Where("id = ?", id).Error
err = global.GVA_DB.Table("search_result").Where("id = ?", id).
UpdateColumn("status", status).Error
return err
}

Expand Down

0 comments on commit fdcedf5

Please sign in to comment.