chore: adjust grom find 1 sql

This commit is contained in:
engigu
2026-03-23 12:04:29 +08:00
parent ec2cd7d116
commit d396e1629f
20 changed files with 87 additions and 52 deletions
+2 -1
View File
@@ -118,7 +118,8 @@ func (lc *LogController) GetLogDetail(c *gin.Context) {
}
var log models.TaskLog
if err := database.DB.Where("id = ?", id).First(&log).Error; err != nil {
res := database.DB.Where("id = ?", id).Limit(1).Find(&log)
if res.Error != nil || res.RowsAffected == 0 {
utils.NotFound(c, "日志不存在")
return
}