diff --git a/src/app/user/controllers/UserController.php b/src/app/user/controllers/UserController.php index 59f4be66892e56aa6d6724a2d2774df1f01340f7..0245eda4839be72723f617dcf6287ba850ee0743 100755 --- a/src/app/user/controllers/UserController.php +++ b/src/app/user/controllers/UserController.php @@ -406,7 +406,27 @@ class UserController ]; } - return $response->withJson(['isDeletable' => true, 'listTemplates' => $listTemplates, 'listInstances' => $listInstances]); + $rawWorkflowListInstances = ListInstanceModel::get([ + 'select' => ['res_id'], + 'where' => ['item_id = ?', 'difflist_type = ?', 'process_date is null'], + 'data' => [$aArgs['id'], 'VISA_CIRCUIT'], + 'groupBy' => ['res_id'] + ]); + $workflowListInstances = []; + foreach ($rawWorkflowListInstances as $rawWorkflowListInstance) { + $rawListInstances = ListInstanceModel::get([ + 'select' => ['*'], + 'where' => ['res_id = ?', 'difflist_type = ?'], + 'data' => [$rawWorkflowListInstance['res_id'], 'VISA_CIRCUIT'], + 'orderBy' => ['listinstance_id'] + ]); + $workflowListInstances[] = [ + 'resId' => $rawWorkflowListInstance['res_id'], + 'listInstances' => $rawListInstances + ]; + } + + return $response->withJson(['isDeletable' => true, 'listTemplates' => $listTemplates, 'listInstances' => $listInstances, 'workflowListInstances' => $workflowListInstances]); } public function suspend(Request $request, Response $response, array $aArgs)