예제 #1
0
 public function countWorkflowTask()
 {
     $user_name = '';
     if (auth()->user() != null) {
         $user_name = auth()->user()->username;
     }
     $tmworkflow = collect(TmWorkflow::where(['ISRUN' => 'yes'])->get(['ID']))->toArray();
     $tmworkflow = collect(TmWorkflow::where(['ISRUN' => 'yes'])->get(['ID']))->toArray();
     $tmworkflowtask = TmWorkflowTask::whereIn('ISRUN', [2, 3])->whereIn('WF_ID', $tmworkflow)->where(function ($q) use($user_name) {
         $q->where('USER', 'like', '%,' . $user_name . ',%');
         $q->orWhere('USER', 'like', $user_name . ',%');
         $q->orWhere('USER', 'like', '%,' . $user_name);
         $q->orWhere('USER', '=', $user_name);
     })->get(['WF_ID']);
     return response()->json(count($tmworkflowtask));
 }
예제 #2
0
 private function getTmWorkflow()
 {
     $result = TmWorkflow::where(['STATUS' => 1])->get(['id', 'name', 'isrun']);
     return $result;
 }
예제 #3
0
 public function finishWorkflow($task_id)
 {
     $r = TmWorkflowTask::where(['ID' => $task_id])->select('wf_id')->first();
     if (count($r) > 0) {
         TmWorkflow::where(['ID' => $r['wf_id']])->update(['ISRUN' => 'no']);
     }
 }