|
|
|
@ -76,6 +76,7 @@ class AgentService |
|
|
|
|
if($differenceInDays > self::DISTANCE_DAY_DEFAULT){ |
|
|
|
|
$dataInsert['agent_id'] = $agentId; |
|
|
|
|
$this->modelCustomer->insert($dataInsert); |
|
|
|
|
$this->modelCustomer->byPhone($dataInput['phone'])->notAgent($agentId)->delete(); |
|
|
|
|
}else{ |
|
|
|
|
$dataInsert['agent_id'] = $customerAgentAllTime[0]->agent_id; |
|
|
|
|
$this->modelCustomer->insert($dataInsert); |
|
|
|
@ -83,6 +84,7 @@ class AgentService |
|
|
|
|
}else{ |
|
|
|
|
$dataInsert['agent_id'] = $agentId; |
|
|
|
|
$this->modelCustomer->insert($dataInsert); |
|
|
|
|
$this->modelCustomer->byPhone($dataInput['phone'])->notAgent($agentId)->delete(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|