资源权限功能示例

This commit is contained in:
pixel
2020-02-25 18:15:20 +08:00
parent a8cbf2d773
commit 3e41b84ea8
8 changed files with 216 additions and 2 deletions

View File

@@ -74,3 +74,8 @@ func (a *SysAuthority) SetDataAuthority() error {
err := qmsql.DEFAULTDB.Model(&s).Association("DataAuthorityId").Replace(&a.DataAuthorityId).Error
return err
}
func (a *SysAuthority) GetAuthorityInfo() (err error,sa SysAuthority) {
err = qmsql.DEFAULTDB.Preload("DataAuthorityId").Where("authority_id = ?",a.AuthorityId).First(&sa).Error
return err,sa
}