Skip to content

Commit

Permalink
chore:fix issue 1605
Browse files Browse the repository at this point in the history
  • Loading branch information
taolx0 committed Aug 23, 2023
1 parent 824d43c commit b6ddf19
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion sqle/model/workflow_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,14 @@ LEFT JOIN workflow_steps AS curr_ws ON wr.current_workflow_step_id = curr_ws.id
LEFT JOIN workflow_step_templates AS curr_wst ON curr_ws.workflow_step_template_id = curr_wst.id
LEFT JOIN workflow_step_user AS curr_wst_re_user ON curr_ws.id = curr_wst_re_user.workflow_step_id
LEFT JOIN users AS curr_ass_user ON curr_wst_re_user.user_id = curr_ass_user.id
LEFT JOIN workflow_instance_record_user wiru ON wiru.workflow_instance_record_id = wir.id
{{- if .check_user_can_access }}
LEFT JOIN workflow_steps AS all_ws ON w.id = all_ws.workflow_id AND all_ws.state !='initialized'
LEFT JOIN workflow_step_templates AS all_wst ON all_ws.workflow_step_template_id = all_wst.id
LEFT JOIN workflow_step_user AS all_wst_re_user ON all_ws.id = all_wst_re_user.workflow_step_id
LEFT JOIN users AS all_ass_user ON all_wst_re_user.user_id = all_ass_user.id
LEFT JOIN workflow_instance_record_user all_wiru ON all_wiru.workflow_instance_record_id = wir.id
{{- end }}
WHERE
w.deleted_at IS NULL
Expand All @@ -81,6 +83,9 @@ AND (
w.create_user_id = :current_user_id
OR curr_ass_user.id = :current_user_id
OR all_ass_user.id = :current_user_id
OR IF(wr.status = 'wait_for_execution'
, all_wiru.user_id = :current_user_id
, '')
{{- if .viewable_instance_ids }}
OR inst.id IN ( {{ .viewable_instance_ids }})
Expand Down Expand Up @@ -122,7 +127,11 @@ AND wr.status IN (:filter_status)
{{- end }}
{{- if .filter_current_step_assignee_user_name }}
AND curr_ass_user.login_name = :filter_current_step_assignee_user_name
AND (curr_ass_user.login_name = :filter_current_step_assignee_user_name
OR IF(wr.status = 'wait_for_execution'
, wiru.user_id = (SELECT id FROM users WHERE users.login_name = :filter_current_step_assignee_user_name )
, '')
)
{{- end }}
{{- if .filter_task_status }}
Expand Down

0 comments on commit b6ddf19

Please sign in to comment.