UPDATE API REGISTER

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

@ -102,12 +102,12 @@ class AuthApiController extends BaseAuthApiController
$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,
@ -115,7 +115,8 @@ class AuthApiController extends BaseAuthApiController
'code' => $dataInsert['phone'],
'agent_root_id' => $checkUserAgent->agent_root_id
]);
};
}
;
}
return response()->json(['status' => true, 'msg' => $this->getMessageReponse(1)]);
}

Loading…
Cancel
Save