diff --git a/QMPlusServer/model/sysModel/sys_authority.go b/QMPlusServer/model/sysModel/sys_authority.go index 50a165e3..8efb96df 100644 --- a/QMPlusServer/model/sysModel/sys_authority.go +++ b/QMPlusServer/model/sysModel/sys_authority.go @@ -27,7 +27,7 @@ func (a *SysAuthority) CreateAuthority() (err error, authority *SysAuthority) { func (a *SysAuthority) DeleteAuthority() (err error) { err = qmsql.DEFAULTDB.Where("authority_id = ?", a.AuthorityId).Find(&SysUser{}).Error if err != nil { - err = qmsql.DEFAULTDB.Where("parentId = ?", a.AuthorityId).Find(&SysAuthority{}).Error + err = qmsql.DEFAULTDB.Where("parent_id = ?", a.AuthorityId).Find(&SysAuthority{}).Error if err != nil { err = qmsql.DEFAULTDB.Where("authority_id = ?", a.AuthorityId).First(a).Unscoped().Delete(a).Error new(CasbinModel).clearCasbin(0, a.AuthorityId) @@ -75,7 +75,7 @@ func (a *SysAuthority) SetDataAuthority() 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 -} \ No newline at end of file +func (a *SysAuthority) GetAuthorityInfo() (err error, sa SysAuthority) { + err = qmsql.DEFAULTDB.Preload("DataAuthorityId").Where("authority_id = ?", a.AuthorityId).First(&sa).Error + return err, sa +}