fixed: 流水线排序字段

This commit is contained in:
yystopf 2025-08-25 15:51:44 +08:00
parent 03a406ca34
commit 32408fc2c6
1 changed files with 2 additions and 2 deletions

View File

@ -70,10 +70,10 @@ class Api::Pm::PipelinesController < Api::Pm::BaseController
# Rails.logger.info("@run_result======#{@run_result}")
@disabled_workflows = Gitea::RepoUnit.where(repo_id: project_gpids, type: 10).where("config is not null")
@pipelines = Action::Pipeline.select("distinct project_id,max(updated_at) as updated_at")
.where(project_id: @project_ids).group(:project_id).order("updated_at desc")
.where(project_id: @project_ids).group(:project_id).order("created_at desc")
@pipelines = @pipelines.where("pipeline_name like ?", "%#{params[:pipeline_name]}%") if params[:pipeline_name].present?
@pipelines = @pipelines.where(pipeline_type: params[:pipeline_type]) if params[:pipeline_type].present?
@pipelines = kaminari_paginate(@pipelines.order("action_pipelines.id asc"))
@pipelines = kaminari_paginate(@pipelines)
end
end