|
|
|
@@ -14,11 +14,10 @@ class Issues::ListQueryService < ApplicationService |
|
|
|
end_time = params[:due_date] |
|
|
|
|
|
|
|
issues = all_issues.issue_index_includes |
|
|
|
|
|
|
|
if status_type.to_s == "1" #表示开启中的 |
|
|
|
issues = issues.where.not(status_id: 5) |
|
|
|
elsif status_type.to_s == "2" #表示关闭中的 |
|
|
|
if status_type.to_s == "2" #表示关闭中的 |
|
|
|
issues = issues.where(status_id: 5) |
|
|
|
else |
|
|
|
issues = issues.where.not(status_id: 5) #默认显示开启中的 |
|
|
|
end |
|
|
|
|
|
|
|
if search_name.present? |
|
|
|
@@ -41,7 +40,7 @@ class Issues::ListQueryService < ApplicationService |
|
|
|
|
|
|
|
order_type = params[:order_type] || "desc" #或者"asc" |
|
|
|
order_name = params[:order_name] || "created_on" #或者"updated_on" |
|
|
|
issues.reorder("issues.#{order_name} #{order_type}") |
|
|
|
issues.order("issues.#{order_name} #{order_type}") |
|
|
|
end |
|
|
|
|
|
|
|
end |