package implement import ( "applet/app/db/dao" "applet/app/db/model" "applet/app/enum" "applet/app/utils/logx" "xorm.io/xorm" ) func NewAgentPermissionGroupDb(engine *xorm.Engine) dao.AgentPermissionGroupDao { return &AgentPermissionGroupDb{Db: engine} } type AgentPermissionGroupDb struct { Db *xorm.Engine } func (a AgentPermissionGroupDb) FindAgentPermissionGroup() (*[]model.AgentPermissionGroup, error) { var mm []model.AgentPermissionGroup if err := a.Db.Where("state = ?", enum.PermissionGroupStateForNormal).Asc("id").Find(&mm); err != nil { return nil, logx.Error(err) } return &mm, nil } func (a AgentPermissionGroupDb) FindAgentPermissionGroupV2() (*[]model.AgentPermissionGroup, error) { var mm []model.AgentPermissionGroup if err := a.Db.Asc("id").Find(&mm); err != nil { return nil, logx.Error(err) } return &mm, nil }