package db import ( "egg-im/internal/business/comm/db/model" "egg-im/pkg/db" "egg-im/pkg/gerrors" ) type dbEmoticon struct{} var DbEmoticon = new(dbEmoticon) // EmoticonFind 获取记录 func (*dbEmoticon) EmoticonFind() (*[]model.Emoticon, error) { var list []model.Emoticon if err := db.DB.Where("`state` = 1").Order("sort desc").Find(&list).Error; err != nil { return nil, gerrors.WrapError(err) } return &list, nil }