fix add customer

main
nocode 1 year ago
parent 6b90a0a51c
commit f9c74063e0
  1. 1
      Modules/Agents/Services/AgentService.php

@ -64,6 +64,7 @@ class AgentService
// chưa quá 15 ngày thì lấy cái agent_id cũ, đang trực thuộc
$dataInsert['agent_id'] = $customerInAgent->agent_id;
$result = $this->modelCustomer->insert($dataInsert);
$this->modelCustomer->where('phone', $dataInput['phone'])->where('agent_id', '<>', $customerInAgent->agent_id)->delete();
} else {
// quá 15 ngày thì lấy agent_id check ra từ mã đại lý
$dataInsert['agent_id'] = $agentId;

Loading…
Cancel
Save