UPDATE API REGISTER

main
nocode 1 year ago
parent 5b3fcc0eff
commit 18425ca211
  1. 13
      app/Http/Controllers/Api/AuthApiController.php

@ -60,7 +60,8 @@ class AuthApiController extends BaseAuthApiController
$myAgent = Agent::find($agentUser->agent_id);
}
$phone = $myAgent->phone ?? null;
$phone = $user->phone ?? null;
$data['general_agents_code'] = $agentRootInfo->code ?? '';
$data['general_agents_name'] = $agentRootInfo->name ?? '';
$data['downline_register'] = $this->getLinkParam('downline_register', $phone);
@ -107,12 +108,18 @@ class AuthApiController extends BaseAuthApiController
];
$agentInsertId = Agent::insertGetId($dataAgentInsert);
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' => false, 'msg' => $this->getMessageReponse(2)]);
}
public function logout(Request $request)

Loading…
Cancel
Save