|
|
@ -60,7 +60,8 @@ class AuthApiController extends BaseAuthApiController |
|
|
|
$myAgent = Agent::find($agentUser->agent_id); |
|
|
|
$myAgent = Agent::find($agentUser->agent_id); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$phone = $myAgent->phone ?? null; |
|
|
|
$phone = $user->phone ?? null; |
|
|
|
|
|
|
|
|
|
|
|
$data['general_agents_code'] = $agentRootInfo->code ?? ''; |
|
|
|
$data['general_agents_code'] = $agentRootInfo->code ?? ''; |
|
|
|
$data['general_agents_name'] = $agentRootInfo->name ?? ''; |
|
|
|
$data['general_agents_name'] = $agentRootInfo->name ?? ''; |
|
|
|
$data['downline_register'] = $this->getLinkParam('downline_register', $phone); |
|
|
|
$data['downline_register'] = $this->getLinkParam('downline_register', $phone); |
|
|
@ -107,7 +108,13 @@ class AuthApiController extends BaseAuthApiController |
|
|
|
]; |
|
|
|
]; |
|
|
|
$agentInsertId = Agent::insertGetId($dataAgentInsert); |
|
|
|
$agentInsertId = Agent::insertGetId($dataAgentInsert); |
|
|
|
if($agentInsertId){ |
|
|
|
if($agentInsertId){ |
|
|
|
AgentUser::insert(['user_id' => $userId, 'agent_id' => $agentInsertId, 'status' => 1, 'code' => $dataInsert['phone']]); |
|
|
|
AgentUser::insert([ |
|
|
|
|
|
|
|
'user_id' => $userId, |
|
|
|
|
|
|
|
'agent_id' => $agentInsertId, |
|
|
|
|
|
|
|
'status' => 1, |
|
|
|
|
|
|
|
'code' => $dataInsert['phone'], |
|
|
|
|
|
|
|
'agent_root_id' => $checkUserAgent->agent_root_id |
|
|
|
|
|
|
|
]); |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
return response()->json(['status' => true, 'msg' => $this->getMessageReponse(1)]); |
|
|
|
return response()->json(['status' => true, 'msg' => $this->getMessageReponse(1)]); |
|
|
|