fix: 修复检测更新 API 使用正确的字段名
- 将 status 字段改为 publish_status - 将 active 值改为 published - 确保能正确查询已发布的版本 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -62,9 +62,9 @@ func handleAppCheckUpdate(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询该应用的所有版本,按ID降序(创建顺序)
|
// 查询该应用的所有已发布版本,按ID降序(创建顺序)
|
||||||
var allVersions []model.Version
|
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").
|
Order("id DESC").
|
||||||
Preload("Files").
|
Preload("Files").
|
||||||
Find(&allVersions).Error; err != nil {
|
Find(&allVersions).Error; err != nil {
|
||||||
@@ -252,8 +252,8 @@ func handleAppCheckUpdate(c *gin.Context) {
|
|||||||
// 检查是否有适合客户端版本的增量更新
|
// 检查是否有适合客户端版本的增量更新
|
||||||
// 查找以客户端版本为基础版本的 patch 更新
|
// 查找以客户端版本为基础版本的 patch 更新
|
||||||
var patchVersion model.Version
|
var patchVersion model.Version
|
||||||
err := database.DB.Where("application_id = ? AND update_type = ? AND base_version_id = ? AND status = ?",
|
err := database.DB.Where("application_id = ? AND update_type = ? AND base_version_id = ? AND publish_status = ?",
|
||||||
app.ID, "patch", clientVersionRecord.ID, "active").
|
app.ID, "patch", clientVersionRecord.ID, "published").
|
||||||
Order("id DESC").
|
Order("id DESC").
|
||||||
Preload("Files").
|
Preload("Files").
|
||||||
First(&patchVersion).Error
|
First(&patchVersion).Error
|
||||||
|
|||||||
Reference in New Issue
Block a user