From d9c7b5c8f90121bd9bc380726d1b1b726b4abc68 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 10 Dec 2019 12:42:53 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B6=85=E7=AE=A1=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/admins/myshixuns_controller.rb | 1 + app/views/admins/myshixuns/shared/_list.html.erb | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/controllers/admins/myshixuns_controller.rb b/app/controllers/admins/myshixuns_controller.rb index f70a64554..adc34e95e 100644 --- a/app/controllers/admins/myshixuns_controller.rb +++ b/app/controllers/admins/myshixuns_controller.rb @@ -6,6 +6,7 @@ class Admins::MyshixunsController < Admins::BaseController myshixuns = Admins::MyshixunQuery.call(params) @myshixuns = paginate myshixuns.includes(:last_executable_task, :last_task, shixun: :user, user: { user_extension: :school }) + @params_page = params[:page] || 1 myshixun_ids = @myshixuns.map(&:id) @finish_game_count = Game.where(myshixun_id: myshixun_ids, status: 2).group(:myshixun_id).count diff --git a/app/views/admins/myshixuns/shared/_list.html.erb b/app/views/admins/myshixuns/shared/_list.html.erb index 440437320..a80a4ef23 100644 --- a/app/views/admins/myshixuns/shared/_list.html.erb +++ b/app/views/admins/myshixuns/shared/_list.html.erb @@ -1,9 +1,10 @@ + - + @@ -14,8 +15,9 @@ <% if myshixuns.present? %> - <% myshixuns.each do |myshixun| %> + <% myshixuns.each_with_index do |myshixun, index| %> +
序号 ID 标识实训名称实训名称 实训老师 完成 经验值
<%= list_index_no(@params_page.to_i, index) %> <%= myshixun.id %> <%= myshixun.identifier %>