修改issues的列表页的错误

This commit is contained in:
sylor_huang@126.com 2020-05-08 15:05:53 +08:00
parent ce0e3754eb
commit a5be19f3a3
1 changed files with 4 additions and 5 deletions

View File

@ -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