新增:里程碑列表支持id查询

This commit is contained in:
yystopf 2023-02-27 11:25:37 +08:00
parent 4c26085e58
commit ff025e07dd
1 changed files with 1 additions and 1 deletions

View File

@ -7,7 +7,7 @@ class Api::V1::Issues::MilestonesController < Api::V1::BaseController
# 里程碑列表
def index
@milestones = @project.versions
@milestones = @milestones.ransack(name_or_description_cont: params[:keyword]).result if params[:keyword].present?
@milestones = @milestones.ransack(id_eq: params[:keyword]).result.or(@milestones.ransack(name_or_description_cont: params[:keyword]).result) if params[:keyword].present?
@closed_milestone_count = @milestones.closed.size
@opening_milestone_count = @milestones.opening.size
@milestones = params[:category] == "closed" ? @milestones.closed : @milestones.opening