From 4fbf7a52cd63c50d25c6e4cdcbdbf5d30646b58e Mon Sep 17 00:00:00 2001 From: yystopf Date: Wed, 15 May 2024 15:00:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=EF=BC=9A=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E5=88=86=E6=94=AF=E5=88=97=E8=A1=A8=E5=8F=96?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E6=97=B6=E9=97=B4=E6=9C=80=E6=96=B0=E7=9A=84?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= 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 ada71fa7d..f8b466420 100644 --- a/app/controllers/api/v1/projects/sync_repositories_controller.rb +++ b/app/controllers/api/v1/projects/sync_repositories_controller.rb @@ -112,7 +112,7 @@ class Api::V1::Projects::SyncRepositoriesController < Api::V1::BaseController @group_sync_repository_branch = @sync_repository_branches.joins(:sync_repository).group("sync_repositories.type, sync_repository_branches.gitlink_branch_name, sync_repository_branches.external_branch_name").select("sync_repositories.type as type,max(sync_repository_branches.updated_at) as updated_at, sync_repository_branches.gitlink_branch_name, sync_repository_branches.external_branch_name").sort_by{|i|i.updated_at} @each_json = [] @group_sync_repository_branch.each do |item| - branches = @sync_repository_branches.joins(:sync_repository).where(sync_repositories: {type: item.type}, gitlink_branch_name: item.gitlink_branch_name, external_branch_name: item.external_branch_name).order(updated_at: :desc) + branches = @sync_repository_branches.joins(:sync_repository).where(sync_repositories: {type: item.type}, gitlink_branch_name: item.gitlink_branch_name, external_branch_name: item.external_branch_name).order(sync_time: :desc) branch = branches.first @each_json << { gitlink_branch_name: item.gitlink_branch_name,