Browse Source

修复了表字段不同的bug

main
pixel 5 years ago
parent
commit
15d17c7a9a
  1. 10
      QMPlusServer/model/sysModel/sys_authority.go

10
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
}
func (a *SysAuthority) GetAuthorityInfo() (err error, sa SysAuthority) {
err = qmsql.DEFAULTDB.Preload("DataAuthorityId").Where("authority_id = ?", a.AuthorityId).First(&sa).Error
return err, sa
}
Loading…
Cancel
Save