Browse Source

修复了表字段不同的bug

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

2
QMPlusServer/model/sysModel/sys_authority.go

@ -27,7 +27,7 @@ func (a *SysAuthority) CreateAuthority() (err error, authority *SysAuthority) {
func (a *SysAuthority) DeleteAuthority() (err error) { func (a *SysAuthority) DeleteAuthority() (err error) {
err = qmsql.DEFAULTDB.Where("authority_id = ?", a.AuthorityId).Find(&SysUser{}).Error err = qmsql.DEFAULTDB.Where("authority_id = ?", a.AuthorityId).Find(&SysUser{}).Error
if err != nil { 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 { if err != nil {
err = qmsql.DEFAULTDB.Where("authority_id = ?", a.AuthorityId).First(a).Unscoped().Delete(a).Error err = qmsql.DEFAULTDB.Where("authority_id = ?", a.AuthorityId).First(a).Unscoped().Delete(a).Error
new(CasbinModel).clearCasbin(0, a.AuthorityId) new(CasbinModel).clearCasbin(0, a.AuthorityId)

Loading…
Cancel
Save