数据结构优化

This commit is contained in:
李琦
2026-01-20 08:31:42 +08:00
parent 41b2530510
commit adb1b8ca94
3 changed files with 133 additions and 76 deletions

View File

@@ -15,6 +15,7 @@ func GetWorks() ([]models.Work, error) {
var works []models.Work
err := config.DB.Model(&models.Work{}).
Where("deleted_at = ?", 0).
Order("id DESC").
Find(&works).Error
if err != nil {
log.Printf("Error querying works: %v", err)