From 31ede9c69de62f166991c60e57de8de9b26d0101 Mon Sep 17 00:00:00 2001 From: yystopf Date: Thu, 25 Apr 2024 14:45:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9Agroup=20by=20sync=20?= =?UTF-8?q?repository?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/api/v1/projects/sync_repositories_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/v1/projects/sync_repositories_controller.rb b/app/controllers/api/v1/projects/sync_repositories_controller.rb index 7a74ecc47..d20b43bf9 100644 --- a/app/controllers/api/v1/projects/sync_repositories_controller.rb +++ b/app/controllers/api/v1/projects/sync_repositories_controller.rb @@ -97,7 +97,7 @@ class Api::V1::Projects::SyncRepositoriesController < Api::V1::BaseController return render_error("请输入正确的同步仓库ID") unless params[:sync_repository_ids].present? @sync_repository_branches = SyncRepositoryBranch.where(sync_repository_id: params[:sync_repository_ids].split(",")) @sync_repository_branches = @sync_repository_branches.ransack(gitlink_branch_name_or_external_branch_name_cont: params[:branch_name]).result if params[:branch_name].present? - @group_sync_repository_branch = @sync_repository_branches.group(:gitlink_branch_name, :external_branch_name).select("max(updated_at) as updated_at, gitlink_branch_name, external_branch_name").sort_by{|i|i.updated_at} + @group_sync_repository_branch = @sync_repository_branches.group(:sync_repository_id, :gitlink_branch_name, :external_branch_name).select("max(updated_at) as updated_at, sync_repository_id, gitlink_branch_name, external_branch_name").sort_by{|i|i.updated_at} end def history