fusenapi/model/gmodel/fs_font_logic.go

22 lines
383 B
Go
Raw Normal View History

2023-06-15 08:08:43 +00:00
package gmodel
import (
"context"
)
// TODO: 使用model的属性做你想做的
func (m *FsFontModel) FindAllOrderSortByDesc(ctx context.Context) ([]*FsFont, error) {
var fonts []*FsFont
err := m.db.Model(&FsFont{}).Order("sort desc").Find(&fonts).Error
switch err {
case nil:
return fonts, nil
case ErrRecordNotFound:
return nil, nil
default:
return nil, err
}
}