更改:同步记录分支列表取同步时间最新的数据
This commit is contained in:
		
							parent
							
								
									5559330706
								
							
						
					
					
						commit
						4fbf7a52cd
					
				| 
						 | 
					@ -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}
 | 
					    @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 = []
 | 
					    @each_json = []
 | 
				
			||||||
    @group_sync_repository_branch.each do |item|
 | 
					    @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
 | 
					      branch = branches.first
 | 
				
			||||||
      @each_json << {
 | 
					      @each_json << {
 | 
				
			||||||
        gitlink_branch_name: item.gitlink_branch_name,
 | 
					        gitlink_branch_name: item.gitlink_branch_name,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue