From c2651d08307293488a006385f6b8046f7da143b9 Mon Sep 17 00:00:00 2001 From: nocode Date: Thu, 18 Jul 2024 17:27:12 +0700 Subject: [PATCH] add customer --- Modules/Agents/Services/AgentService.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Modules/Agents/Services/AgentService.php b/Modules/Agents/Services/AgentService.php index bd4e4e8..ecbc2dc 100644 --- a/Modules/Agents/Services/AgentService.php +++ b/Modules/Agents/Services/AgentService.php @@ -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(); } }