|
|
|
@ -56,6 +56,9 @@ class AuthApiController extends BaseAuthApiController |
|
|
|
|
if (!empty($agentUser->agent_root_id)) { |
|
|
|
|
// Agent User Root |
|
|
|
|
$agentRootInfo = Agent::find($agentUser->agent_root_id); |
|
|
|
|
$agentUserRoot = AgentUser::where('agent_id', $agentUser->agent_root_id)->where('agent_root_id', $agentUser->agent_root_id)->latest()->first(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
if (!empty($agentUser->agent_id)) { |
|
|
|
|
// Agent User Current |
|
|
|
@ -64,7 +67,7 @@ class AuthApiController extends BaseAuthApiController |
|
|
|
|
|
|
|
|
|
$phone = $user->phone ?? null; |
|
|
|
|
|
|
|
|
|
$data['general_agents_code'] = $agentUser->code ?? ''; |
|
|
|
|
$data['general_agents_code'] = $agentUserRoot->code ?? ''; |
|
|
|
|
$data['general_agents_name'] = $agentRootInfo->name ?? ''; |
|
|
|
|
$data['downline_register'] = $this->getLinkParam('downline_register', $agentUser->code); |
|
|
|
|
$data['promotional_link'] = $this->getLinkParam('promotional_link', $agentUser->code); |
|
|
|
@ -137,7 +140,8 @@ class AuthApiController extends BaseAuthApiController |
|
|
|
|
|
|
|
|
|
return response()->json(['status' => false, 'msg' => $this->getMessageReponse(2)]); |
|
|
|
|
} |
|
|
|
|
public function generateNewCode($code){ |
|
|
|
|
public function generateNewCode($code) |
|
|
|
|
{ |
|
|
|
|
$newCode = ''; |
|
|
|
|
if (!empty($code)) { |
|
|
|
|
$latestCodeNumber = (int) substr($code, 1); |
|
|
|
|