更改:项目活跃度排行默认统计一周内的数据

This commit is contained in:
yystopf 2023-12-20 09:51:51 +08:00
parent ae8b86ef02
commit 3f621bd5b5
4 changed files with 4 additions and 4 deletions

View File

@ -17,7 +17,7 @@ class Admins::ProjectsRankController < Admins::BaseController
private
def begin_date
params.fetch(:begin_date, Date.today.to_s)
params.fetch(:begin_date, (Date.today-7.days).to_s)
end
def end_date

View File

@ -7,7 +7,7 @@
<%= form_tag(admins_projects_rank_index_path, method: :get, class: 'form-inline search-form flex-1', id: 'project-rank-date-form') do %>
<div class="input-group">
<span class="input-group-text">开始日期</span>
<input class="form-control datetimepicker" type="text" name="begin_date" value="<%= params[:begin_date] || Date.today.to_s%>" aria-label="选择日期">
<input class="form-control datetimepicker" type="text" name="begin_date" value="<%= params[:begin_date] || (Date.today - 7.days).to_s%>" aria-label="选择日期">
</div>
<div class="input-group">
<span class="input-group-text">截止日期</span>

View File

@ -18,7 +18,7 @@
<tr class="">
<td><%= index + 1%></td>
<td>
<a href="<%= "/#{item&.project&.owner&.login}/#{item&.project&.identifier}"%>">
<a target="_blank" href="<%= "/#{item&.project&.owner&.login}/#{item&.project&.identifier}"%>">
<%= "#{item&.project&.owner&.real_name}/#{item&.project&.name}" %>
</a>
</td>

View File

@ -34,7 +34,7 @@
<td><%= index + 1%></td>
<% owner_common = $redis_cache.hgetall("v2-owner-common:#{item[0]}")%>
<td>
<a href="/<%= owner_common["login"] %>">
<a target="_blank" href="/<%= owner_common["login"] %>">
<%= owner_common["name"] %>
</a>
</td>