$workflowSelect="SELECT id FROM workflows ws WHERE workflows.main_document_id = main_document_id AND process_date IS NULL AND status IS NULL ORDER BY \"order\" LIMIT 1";
$workflowSelect="SELECT main_document_id FROM workflows WHERE user_id in (?) AND id in ({$workflowSelect})";
$where=["id in ({$workflowSelect}) OR typist = ?"];
$data=[$users,$GLOBALS['id']];
$where=["id in ({$workflowSelect}) OR typist = ?"];
$data=[$users,$GLOBALS['id']];
}
$whereWorkflow=[];
...
...
@@ -66,28 +66,28 @@ class SearchController
$whereStatuses[]="main_document_id in (SELECT DISTINCT main_document_id FROM workflows WHERE status is null)";