From f2ee787aef37ad147aa0a769efdf1075350f59ed Mon Sep 17 00:00:00 2001 From: nocode Date: Tue, 16 Jul 2024 17:00:43 +0700 Subject: [PATCH] ADD config docker --- Modules/Agents/Services/AgentService.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Modules/Agents/Services/AgentService.php b/Modules/Agents/Services/AgentService.php index a004677..804801a 100644 --- a/Modules/Agents/Services/AgentService.php +++ b/Modules/Agents/Services/AgentService.php @@ -171,7 +171,13 @@ class AgentService $agentParent = $listAgentById[$vByAgent->grant_parent_id]; $upGrant = $agentParent->code ?? null; } - $data[] = [ + if($agentId == $vByAgent->agent_id) continue; // skip agent root + + if(!empty($input['up_grant'])){ // if existing up_geant + if($upGrant != $input['up_grant']) continue; // skip + } + + $finalDataTemp[] = [ 'id' => $vByAgent->id ?? '', 'name' => $vByAgent->agent_name ?? '', 'agents_code' => $vByAgent->code ?? '', @@ -183,6 +189,7 @@ class AgentService ]; } } + $data = $finalDataTemp; return ['status' => true, 'data' => $data, 'msg' => $this->getMessageReturn('success')]; } /**