fix🐛: 修复获取部门数据查询参数问题

This commit is contained in:
zhangwenjian committed 2021-06-20 00:15:34 +08:00
1 parent b97b3bc6d8
commit 993115c8ae
1 file changed
+1 -1
+1 -1
View File
@@ -204,7 +204,7 @@ func (e *SysRole) UpdateDataScope(c *dto.RoleDataScopeReq) *SysRole {
}()
var dlist = make([]models.SysDept, 0)
var model = models.SysRole{}
tx.Preload("SysDept").First(&model, c.DeptIds)
tx.Preload("SysDept").First(&model, c.RoleId)
tx.Where("id in ?", c.DeptIds).Find(&dlist)
err = tx.Model(&model).Association("SysDept").Delete(model.SysDept)
if err != nil {