超级管理员界面提供导出每个用户提交次数代码次数
This commit is contained in:
parent
a9e62618f1
commit
1afc3fe4d0
|
@ -117,7 +117,31 @@ module ApplicationHelper
|
|||
|
||||
# 管理员界面导出所有项目代码、提交次数统计
|
||||
def admin_export_rep_xls
|
||||
members = Member.where(:course_id => -1)
|
||||
users = User.all
|
||||
user_details = {}
|
||||
results = []
|
||||
users.each do |user|
|
||||
user.projects.each do |project|
|
||||
g = Gitlab.client
|
||||
cycle = params[:cycle]
|
||||
rev = params[:rev]
|
||||
if cycle == "week"
|
||||
statics = g.rep_stats_week(project.gpid, :rev => rev)
|
||||
elsif cycle == "month"
|
||||
statics = g.rep_stats_month(project.gpid, :rev => rev)
|
||||
end.
|
||||
user_details = {:user_id => user.id, :user_name => user.show_name, :project_id => project.id, :project_name => project.name,
|
||||
:commits_num => static.commits_num, :add => static.add, :del => static.del, :changes => static.changes}
|
||||
results << user_details
|
||||
end
|
||||
|
||||
static.commits_num
|
||||
sheet1[count_row,3] = static.add
|
||||
sheet1[count_row,4] = static.del
|
||||
sheet1[count_row,5] = static.changes
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# 项目issue列表导出Excel功能
|
||||
|
|
Loading…
Reference in New Issue