From 54f7137886a0bbf5d0b683de4f4bb92ee907b081 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 20 Jul 2019 20:02:43 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 7b9d622b9..5666884e9 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -185,7 +185,9 @@ class ApplicationController < ActionController::Base # 系统全局认证 def check_auth - if current_user.certification != 1 + if current_user.certification != 1 && current_user.apply_actions.exists?(container_type: 'TrialAuthorization', status: 0) + tip_exception(-1, "您的试用申请正在审核中,请耐心等待") + elsif current_user.certification != 1 day_cer = UserDayCertification.find_by(user_id: current_user.id) tip_exception(407, "系统未授权") unless (Time.now.to_i - day_cer.try(:created_at).to_i) < 86400 elsif !current_user.profile_completed? From e4a2a896e3c398a293e28e2a1ae19fa9a54469c6 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 20 Jul 2019 20:11:22 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E7=9A=84=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_commons_controller.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index 3cde340c6..4685c9f69 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -170,6 +170,7 @@ class HomeworkCommonsController < ApplicationController end @work_count = @student_works.size + @work_excel = @student_works.where("work_status > 0") # 排序 rorder = params[:order].blank? ? "update_time" : params[:order] @@ -180,8 +181,6 @@ class HomeworkCommonsController < ApplicationController @student_works = @student_works.joins(user: :user_extension).order("user_extensions.#{rorder} #{b_order}") end - @work_excel = @student_works - # 分页参数 page = params[:page] || 1 limit = params[:limit] || 20 @@ -195,10 +194,9 @@ class HomeworkCommonsController < ApplicationController end if params[:format] == "xlsx" - complete_works = @work_excel.present? ? @work_excel.where("work_status > 0").size : 0 if @user_course_identity >= Course::STUDENT tip_exception(403, "无权限操作") - elsif complete_works == 0 + elsif @work_excel.size == 0 normal_status(-1,"暂无用户提交!") else respond_to do |format|