新增:转账记录使用json builder以及贡献者新增贡献占比

This commit is contained in:
2023-03-08 11:05:24 +08:00
parent 90773483b8
commit 47a8f17073
6 changed files with 12 additions and 8 deletions

View File

@@ -31,11 +31,9 @@ module Watchable
following.size
end
def contribution_perc
project_identifier = params[:project_identifier]
user_login = params[:id]
@project = Project.find_by_identifier(project_identifier)
@user = User.find_by_login(user_login)
def contribution_perc(project)
@project = project
@user = self
def cal_perc(count_user, count_all)
(count_user * 1.0 / (count_all + 0.000000001)).round(5)