|
|
@ -61,7 +61,7 @@ class AgentService |
|
|
|
$isInAgentDistance = $this->modelCustomer->byPhone($dataInput['phone'])->whereDate('created_at', '>', $dateNotToo)->orderBy('created_at','asc')->get(); |
|
|
|
$isInAgentDistance = $this->modelCustomer->byPhone($dataInput['phone'])->whereDate('created_at', '>', $dateNotToo)->orderBy('created_at','asc')->get(); |
|
|
|
// dd(empty($isInAgentDistance[0])); |
|
|
|
// dd(empty($isInAgentDistance[0])); |
|
|
|
if (empty($isInAgentDistance[0])) { // ko co trong DS 15 ngay |
|
|
|
if (empty($isInAgentDistance[0])) { // ko co trong DS 15 ngay |
|
|
|
dd(1); |
|
|
|
// dd(1); |
|
|
|
$dataInsert['agent_id'] = $agentId; |
|
|
|
$dataInsert['agent_id'] = $agentId; |
|
|
|
$this->modelCustomer->insert($dataInsert); |
|
|
|
$this->modelCustomer->insert($dataInsert); |
|
|
|
$this->modelCustomer->byPhone($dataInput['phone'])->notAgent($agentId)->delete(); |
|
|
|
$this->modelCustomer->byPhone($dataInput['phone'])->notAgent($agentId)->delete(); |
|
|
|