FIX_DELETE
This commit is contained in:
parent
259b8f1b49
commit
4753a877b7
@ -537,10 +537,18 @@ class EmployeeRestController extends AdminController
|
||||
->update();
|
||||
}
|
||||
|
||||
$this->employeePolicyModel->where('employee_id',$this->request->getGet('id') )
|
||||
->where('is_active', 1 )
|
||||
->set(array('is_active'=> 0 ))
|
||||
->update();
|
||||
$query = $this->employeePolicyModel
|
||||
->where('employee_id', $this->request->getGet('id'))
|
||||
->where('is_active', 1);
|
||||
|
||||
// 👉 Add condition only if client_policy_id exists
|
||||
$clientPolicyId = $this->request->getGet('client_policy_id') ?? null;
|
||||
if (!empty($clientPolicyId)) {
|
||||
$query->where('client_policy_id', $clientPolicyId);
|
||||
}
|
||||
|
||||
$query->set(['is_active' => 0])->update();
|
||||
|
||||
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' =>[] ], 200);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user