fix: wrong columnName index

pull/1628/head
Noah Hsu 2022-09-09 16:44:54 +08:00
parent 46325655e1
commit 63569be41d
1 changed files with 1 additions and 1 deletions

View File

@ -35,7 +35,7 @@ func GetStorages(pageIndex, pageSize int) ([]model.Storage, int64, error) {
return nil, 0, errors.Wrapf(err, "failed get storages count") return nil, 0, errors.Wrapf(err, "failed get storages count")
} }
var storages []model.Storage 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 nil, 0, errors.WithStack(err)
} }
return storages, count, nil return storages, count, nil