mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-02 19:30:48 +08:00
修复:group by sync repository
This commit is contained in:
@@ -2,7 +2,7 @@ json.total_count @group_sync_repository_branch.count
|
||||
json.sync_repository_branches @group_sync_repository_branch.each do |item|
|
||||
json.gitlink_branch_name item.gitlink_branch_name
|
||||
json.external_branch_name item.external_branch_name
|
||||
branches = @sync_repository_branches.where(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(updated_at: :desc)
|
||||
branch = branches.first
|
||||
json.type branch&.sync_repository&.type
|
||||
json.sync_time branch.sync_time.present? ? branch.sync_time.strftime("%Y-%m-%d %H:%M:%S") : nil
|
||||
|
||||
Reference in New Issue
Block a user