diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index d12c2a2..7946fc4 100755 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -526,16 +526,22 @@ class EmployeeRestController extends AdminController try { if($this->request->getGet('id')) - { - $this->employeeModel->where('id', $this->request->getGet('id') ) - ->where('is_active', 1 ) - ->set(array('is_active'=> 0 )) - ->update(); + { + $is_from_copy = $this->request->getGet('is_from_copy') ?? null; + + if($is_from_copy == false && $is_from_copy == null){ + + $this->employeeModel->where('id', $this->request->getGet('id') ) + ->where('is_active', 1 ) + ->set(array('is_active'=> 0 )) + ->update(); + } $this->employeePolicyModel->where('employee_id',$this->request->getGet('id') ) ->where('is_active', 1 ) ->set(array('is_active'=> 0 )) ->update(); + return $this->respond(['status' => 'success','code' => 200,'data' =>[] ], 200); }else{