Support unassigned tenant search

This commit is contained in:
710leo 2021-01-13 14:04:56 +08:00
parent a07df519ab
commit 72ec59bdac
1 changed files with 3 additions and 1 deletions

View File

@ -148,7 +148,9 @@ func HostGetsForAdmin(tenant, query, batch, field string, limit, offset int) ([]
func buildHostWhere(tenant, query, batch, field string) *xorm.Session {
session := DB["ams"].Table(new(Host)).OrderBy("ident")
if tenant != "" {
if tenant == "0" {
session = session.Where("tenant=?", "")
} else if tenant != "" {
session = session.Where("tenant=?", tenant)
}