FIX_DEPENDENT_DELETION
This commit is contained in:
parent
76cc67a417
commit
f39dbe7d20
@ -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{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user