diff --git a/src/service/host_manage.go b/src/service/host_manage.go index 9741f0db1a78ccbf98a56efcae7c08b0671e5abd..8f52c7632ac92ff1fc0cf8ef1b571be9befcfc1c 100644 --- a/src/service/host_manage.go +++ b/src/service/host_manage.go @@ -602,7 +602,7 @@ func (h *HostManageSvc) ExportIp(id, uuid string, detectionType int) (fileName s if detectionType == 1 { //列表检测导出 - finder := db.Table("host_manage_list").Where("is_delete = 0 AND host_group_id = ?", cast.ToInt(id)) + finder := db.Table("host_manage_list").Where("is_delete = 0 AND conn_status = 1 AND host_group_id = ?", cast.ToInt(id)) err = finder.Select("ip,port,voucher_type,user_name,password").Find(&hostManageList) if err != nil { err = resp.DbSelectError.WithError(err) @@ -610,7 +610,7 @@ func (h *HostManageSvc) ExportIp(id, uuid string, detectionType int) (fileName s } } else { //新增/编辑检测导出 - finder := db.Table("host_manage_list_cache").Where("id = ?", uuid) + finder := db.Table("host_manage_list_cache").Where("conn_status = 1 AND id = ?", uuid) err = finder.Select("ip,port,voucher_type,user_name,password").Find(&hostManageList) if err != nil { err = resp.DbSelectError.WithError(err)