From b0e6ab01fc309cd925478c9b92aa698773ae91d7 Mon Sep 17 00:00:00 2001 From: Igor Navrotskyj Date: Mon, 9 Oct 2023 14:12:23 +0300 Subject: [PATCH] WTEL-3907 --- store/sqlstore/agent_store.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/store/sqlstore/agent_store.go b/store/sqlstore/agent_store.go index 2a2d6b02..edcf0bd1 100644 --- a/store/sqlstore/agent_store.go +++ b/store/sqlstore/agent_store.go @@ -200,8 +200,8 @@ FROM call_center.cc_agent a_1 WHERE (q_1.team_id IS NULL OR a_1.team_id = q_1.team_id) and q_1.enabled and x.xxx && array [a_1.id] - and coalesce((q_1.payload->'min_online_agents')::int, 0) > 0 - and array_length(x.xxx, 1) <= (q_1.payload->'min_online_agents')::int + and GREATEST(coalesce((q_1.payload->'min_online_agents')::int, 0), 0) > 0 + and array_length(x.xxx, 1) <= GREATEST((q_1.payload->'min_online_agents')::int, 0) and a_1.id = :AgentId::int and a_1.domain_id = :DomainId::int8)`, map[string]interface{}{ "AgentId": agentId,