UPDATE API REGISTER

main
nocode 1 year ago
parent 18425ca211
commit f9b499ae1a
  1. 15
      app/Http/Controllers/Api/AuthApiController.php

@ -97,25 +97,26 @@ class AuthApiController extends BaseAuthApiController
}
$dataInsert = $this->transformRegisterData($request->all());
if (!empty($dataInsert)) {
$userId = \App\Models\User::insertGetId($dataInsert);
if ($userId) {
$dataAgentInsert = [
'name' => $dataInsert['name']??'',
'name' => $dataInsert['name'] ?? '',
'type' => self::AGENTS,
'grant' => $this->_default_grant_two
];
$agentInsertId = Agent::insertGetId($dataAgentInsert);
if($agentInsertId){
if ($agentInsertId) {
AgentUser::insert([
'user_id' => $userId,
'agent_id' => $agentInsertId,
'status' => 1,
'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)]);
}

Loading…
Cancel
Save