From 97dbd7641489546611d17875932d5185722b1027 Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 3 Jun 2026 02:54:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=20API=20=E4=BD=BF=E7=94=A8=E6=AD=A3=E7=A1=AE?= =?UTF-8?q?=E7=9A=84=E5=AD=97=E6=AE=B5=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 status 字段改为 publish_status - 将 active 值改为 published - 确保能正确查询已发布的版本 Co-Authored-By: Claude Opus 4.8 --- backend/internal/router/app/info.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/internal/router/app/info.go b/backend/internal/router/app/info.go index ce08cac..10f5d01 100644 --- a/backend/internal/router/app/info.go +++ b/backend/internal/router/app/info.go @@ -62,9 +62,9 @@ func handleAppCheckUpdate(c *gin.Context) { return } - // 查询该应用的所有版本,按ID降序(创建顺序) + // 查询该应用的所有已发布版本,按ID降序(创建顺序) var allVersions []model.Version - if err := database.DB.Where("application_id = ? AND status = ?", app.ID, "active"). + if err := database.DB.Where("application_id = ? AND publish_status = ?", app.ID, "published"). Order("id DESC"). Preload("Files"). Find(&allVersions).Error; err != nil { @@ -252,8 +252,8 @@ func handleAppCheckUpdate(c *gin.Context) { // 检查是否有适合客户端版本的增量更新 // 查找以客户端版本为基础版本的 patch 更新 var patchVersion model.Version - err := database.DB.Where("application_id = ? AND update_type = ? AND base_version_id = ? AND status = ?", - app.ID, "patch", clientVersionRecord.ID, "active"). + err := database.DB.Where("application_id = ? AND update_type = ? AND base_version_id = ? AND publish_status = ?", + app.ID, "patch", clientVersionRecord.ID, "published"). Order("id DESC"). Preload("Files"). First(&patchVersion).Error