|
|
@ -171,7 +171,13 @@ class AgentService |
|
|
|
$agentParent = $listAgentById[$vByAgent->grant_parent_id]; |
|
|
|
$agentParent = $listAgentById[$vByAgent->grant_parent_id]; |
|
|
|
$upGrant = $agentParent->code ?? null; |
|
|
|
$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 ?? '', |
|
|
|
'id' => $vByAgent->id ?? '', |
|
|
|
'name' => $vByAgent->agent_name ?? '', |
|
|
|
'name' => $vByAgent->agent_name ?? '', |
|
|
|
'agents_code' => $vByAgent->code ?? '', |
|
|
|
'agents_code' => $vByAgent->code ?? '', |
|
|
@ -183,6 +189,7 @@ class AgentService |
|
|
|
]; |
|
|
|
]; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
$data = $finalDataTemp; |
|
|
|
return ['status' => true, 'data' => $data, 'msg' => $this->getMessageReturn('success')]; |
|
|
|
return ['status' => true, 'data' => $data, 'msg' => $this->getMessageReturn('success')]; |
|
|
|
} |
|
|
|
} |
|
|
|
/** |
|
|
|
/** |
|
|
|