From 8e8acf9f21e8893b627c2099b2719abc4aa06b9f Mon Sep 17 00:00:00 2001 From: Arno Kaimbacher Date: Wed, 10 Apr 2019 13:33:23 +0200 Subject: [PATCH] workflow approve: error --- app/Http/Controllers/Publish/WorkflowController.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Publish/WorkflowController.php b/app/Http/Controllers/Publish/WorkflowController.php index 911ad0f..e588ab5 100644 --- a/app/Http/Controllers/Publish/WorkflowController.php +++ b/app/Http/Controllers/Publish/WorkflowController.php @@ -117,11 +117,19 @@ class WorkflowController extends Controller */ public function editorIndex() { + $user = Auth::user(); + $user_id = $user->id; + $builder = Dataset::query(); $datasets = $builder //->where('server_state', 'inprogress') - ->whereIn('server_state', ['released', 'editor_accepted']) - ->get(); + ->whereIn('server_state', ['released']) + //->where('server_state', 'editor_accepted') + ->orWhere(function ($query) use ($user_id) { + $query->where('server_state', 'editor_accepted') + ->where('editor_id', $user_id); + }) + ->get(); return view('workflow.editor_index', compact('datasets')); }