From 22c10fd8995cbcfb1ad09e0edc10256b00b8aa49 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 6 Mar 2020 20:57:42 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=97=AE=E5=8D=B7=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=BC=80=E5=90=AF=E5=AE=9E=E5=90=8D=E8=AE=A4=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/polls_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/polls_controller.rb b/app/controllers/polls_controller.rb index 21a919efd..edb3fba00 100644 --- a/app/controllers/polls_controller.rb +++ b/app/controllers/polls_controller.rb @@ -135,6 +135,7 @@ class PollsController < ApplicationController :course_id => @course.id, :polls_status => 1, :polls_type => "Course", + :un_anonymous => true } @poll = Poll.create!(poll_options) end From 6c656a6bed6932827b257f25795c2bcbb8b680d9 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 7 Mar 2020 10:17:55 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=AD=BE=E5=88=B0=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/weapps/attendances_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/weapps/attendances_controller.rb b/app/controllers/weapps/attendances_controller.rb index d584072c2..3f0eec248 100644 --- a/app/controllers/weapps/attendances_controller.rb +++ b/app/controllers/weapps/attendances_controller.rb @@ -27,7 +27,7 @@ class Weapps::AttendancesController < ApplicationController tip_exception(403) if @user_course_identity >= Course::STUDENT current_date = Date.current current_end_time = Time.current.strftime("%H:%M:%S") - @current_attendance = @course.course_attendances.where("attendance_date = '#{current_date}' and end_time > '#{current_end_time}'") + @current_attendance = @course.course_attendances.where("attendance_date > '#{current_date}' or (attendance_date = '#{current_date}' and end_time > '#{current_end_time}')") .order("attendance_date asc, start_time asc") all_attendances = @course.course_attendances.where("attendance_date < '#{current_date}' or (attendance_date = '#{current_date}' and end_time < '#{current_end_time}')")