main
nocode 1 year ago
parent 44d13d58da
commit 0f7ad64588
  1. 8
      app/Http/Controllers/Api/AuthApiController.php

@ -114,12 +114,18 @@ class AuthApiController extends BaseAuthApiController
$dataInsert = $this->transformRegisterData($request->all());
if (!empty($dataInsert)) {
if (!empty($checkUserAgent->agent_id)) {
$agentParent = Agent::find($checkUserAgent->agent_id);
$grantParent = $agentParent->grant;
}
$userId = \App\Models\User::insertGetId($dataInsert);
if ($userId) {
$dataAgentInsert = [
'name' => $dataInsert['name'] ?? '',
'type' => self::AGENTS,
'grant' => $this->_default_grant_two,
// 'grant' => $this->_default_grant_two,
'grant' => !empty($grantParent)?$grantParent+1:1,
'phone' => $dataInsert['phone'] ?? '',
'address' => $dataInsert['address'] ?? '',
];

Loading…
Cancel
Save