Browse Source

用户管理查询fix

baichengfei 5 years ago
parent
commit
9042d83c15
1 changed files with 8 additions and 1 deletions
  1. 8 1
      src/dashoo.cn/backend/api/controllers/casbin/user.go

+ 8 - 1
src/dashoo.cn/backend/api/controllers/casbin/user.go

@@ -175,7 +175,14 @@ func (this *UserController) List() {
 
 
 	depids := organsvc.GetAllChildById(topid)
-	where := "(IsVisible=1 and IsCompanyUser = 0 and DepartmentId in (" + depids + ") )" //or Id = '" + utils.ToStr(this.User.Id) + "')
+	var where string
+	if topid == "100000000" {
+		where = "(IsVisible=1 and IsCompanyUser = 0 and DepartmentId != 0 )"
+	} else {
+		where = "(IsVisible=1 and IsCompanyUser = 0 and DepartmentId in (" + depids + ") )" //or Id = '" + utils.ToStr(this.User.Id) + "')
+	}
+	//where = "(IsVisible=1 and IsCompanyUser = 0 and DepartmentId in (" + depids + ") )" //or Id = '" + utils.ToStr(this.User.Id) + "')
+
 	//外部用户 IsCompanyUser == 1
 	if IsCompanyUser == "1" {
 		where = "(IsVisible=1 and IsCompanyUser = 1)"