From 63569be41d644532587d88745fa5d7cd4e3b20df Mon Sep 17 00:00:00 2001 From: Noah Hsu Date: Fri, 9 Sep 2022 16:44:54 +0800 Subject: [PATCH] fix: wrong columnName index --- internal/db/storage.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/db/storage.go b/internal/db/storage.go index cd768c4d1a1..cfe5749dcd7 100644 --- a/internal/db/storage.go +++ b/internal/db/storage.go @@ -35,7 +35,7 @@ func GetStorages(pageIndex, pageSize int) ([]model.Storage, int64, error) { return nil, 0, errors.Wrapf(err, "failed get storages count") } var storages []model.Storage - if err := storageDB.Order(columnName("index")).Offset((pageIndex - 1) * pageSize).Limit(pageSize).Find(&storages).Error; err != nil { + if err := storageDB.Order(columnName("order")).Offset((pageIndex - 1) * pageSize).Limit(pageSize).Find(&storages).Error; err != nil { return nil, 0, errors.WithStack(err) } return storages, count, nil