|
|
@ -53,6 +53,13 @@ class AgentService |
|
|
|
$dataInsert = Arr::except($dataInput, ['agents_code']); |
|
|
|
$dataInsert = Arr::except($dataInput, ['agents_code']); |
|
|
|
$dataInsert['agent_id'] = $agentId; |
|
|
|
$dataInsert['agent_id'] = $agentId; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$result = $this->modelCustomer->insert($dataInsert); |
|
|
|
|
|
|
|
\DB::commit(); |
|
|
|
|
|
|
|
return ['status' => true, 'msg' => $this->getMessageReturn('success_insert_customer')]; |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
$dataInsert = Arr::except($dataInput, ['agents_code']); |
|
|
|
|
|
|
|
$dataInsert['agent_id'] = $agentId; |
|
|
|
|
|
|
|
|
|
|
|
$result = $this->modelCustomer->insert($dataInsert); |
|
|
|
$result = $this->modelCustomer->insert($dataInsert); |
|
|
|
\DB::commit(); |
|
|
|
\DB::commit(); |
|
|
|
return ['status' => true, 'msg' => $this->getMessageReturn('success_insert_customer')]; |
|
|
|
return ['status' => true, 'msg' => $this->getMessageReturn('success_insert_customer')]; |
|
|
|