FIX_DEPENDENT_DELETION
This commit is contained in:
parent
76cc67a417
commit
f39dbe7d20
@ -527,15 +527,21 @@ class EmployeeRestController extends AdminController
|
|||||||
|
|
||||||
if($this->request->getGet('id'))
|
if($this->request->getGet('id'))
|
||||||
{
|
{
|
||||||
|
$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') )
|
$this->employeeModel->where('id', $this->request->getGet('id') )
|
||||||
->where('is_active', 1 )
|
->where('is_active', 1 )
|
||||||
->set(array('is_active'=> 0 ))
|
->set(array('is_active'=> 0 ))
|
||||||
->update();
|
->update();
|
||||||
|
}
|
||||||
|
|
||||||
$this->employeePolicyModel->where('employee_id',$this->request->getGet('id') )
|
$this->employeePolicyModel->where('employee_id',$this->request->getGet('id') )
|
||||||
->where('is_active', 1 )
|
->where('is_active', 1 )
|
||||||
->set(array('is_active'=> 0 ))
|
->set(array('is_active'=> 0 ))
|
||||||
->update();
|
->update();
|
||||||
|
|
||||||
return $this->respond(['status' => 'success','code' => 200,'data' =>[] ], 200);
|
return $this->respond(['status' => 'success','code' => 200,'data' =>[] ], 200);
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user