FIX_DELETE
This commit is contained in:
parent
259b8f1b49
commit
4753a877b7
@ -537,10 +537,18 @@ class EmployeeRestController extends AdminController
|
|||||||
->update();
|
->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->employeePolicyModel->where('employee_id',$this->request->getGet('id') )
|
$query = $this->employeePolicyModel
|
||||||
->where('is_active', 1 )
|
->where('employee_id', $this->request->getGet('id'))
|
||||||
->set(array('is_active'=> 0 ))
|
->where('is_active', 1);
|
||||||
->update();
|
|
||||||
|
// 👉 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);
|
return $this->respond(['status' => 'success','code' => 200,'data' =>[] ], 200);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user