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