From 6af535527ebc4ea3485a6968e1e05b8ac86937b5 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 9 Aug 2019 11:27:09 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9F=A5=E9=87=8D?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/homework_commons/group_list.json.jbuilder | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/homework_commons/group_list.json.jbuilder b/app/views/homework_commons/group_list.json.jbuilder index 4c4a0a34d..61464f2c1 100644 --- a/app/views/homework_commons/group_list.json.jbuilder +++ b/app/views/homework_commons/group_list.json.jbuilder @@ -7,7 +7,7 @@ json.group_list do end end # 未分班展示情况放在最后 -if (@course_groups.count != @limit.to_i && @course_groups.count < @limit.to_i) || +if (@course_groups.count != 0 && @course_groups.count < @limit.to_i) || ((@page.to_i - 1)*@limit.to_i == @course_member_count && @course_groups.count == 0) ungroup_work_count = homework_ungroup_works_count(@homework, @ungroup_user_ids) if ungroup_work_count > 0 From 6aab489bb0bcd36f7d44e38fd56aad100186d459 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 9 Aug 2019 11:30:09 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=99=BB=E5=BD=95=E5=90=8E=E6=9B=B4?= =?UTF-8?q?=E6=96=B0last=5Flogin=5Fon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/accounts_controller.rb | 4 +--- app/controllers/homework_commons_controller.rb | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb index e60e37bce..aa9ddebf0 100644 --- a/app/controllers/accounts_controller.rb +++ b/app/controllers/accounts_controller.rb @@ -81,8 +81,6 @@ class AccountsController < ApplicationController return normal_status(-2, "错误的账号或密码") end - @user.update_column(:last_login_on, Time.now) - successful_authentication(@user) session[:user_id] = @user.id @@ -124,7 +122,7 @@ class AccountsController < ApplicationController set_autologin_cookie(user) UserAction.create(:action_id => user.try(:id), :action_type => "Login", :user_id => user.try(:id), :ip => request.remote_ip) - + user.update_column(:last_login_on, Time.now) # 注册完成后有一天的试用申请(先去掉) # UserDayCertification.create(user_id: user.id, status: 1) end diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index 40dd37368..59b807860 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -1350,7 +1350,6 @@ class HomeworkCommonsController < ApplicationController @course_member_count = @course.course_groups.count @course_groups = @course.course_groups.page(@page).per(@limit) @ungroup_user_ids = @course.course_members.ungroup_students.pluck(:user_id) - logger.info("#####course_member_count: #{@course_member_count}, course_groups: #{@course_groups.count}") end # 班级作品查重