From 2bbd5dcc2456a81a64aa7ca8aa547ed019f0d89f Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Sat, 22 Jun 2019 14:59:45 +0800 Subject: [PATCH 1/3] .. --- db/migrate/20190622065825_add_profile_completed_to_uses.rb | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 db/migrate/20190622065825_add_profile_completed_to_uses.rb diff --git a/db/migrate/20190622065825_add_profile_completed_to_uses.rb b/db/migrate/20190622065825_add_profile_completed_to_uses.rb new file mode 100644 index 000000000..ef2cc2bf2 --- /dev/null +++ b/db/migrate/20190622065825_add_profile_completed_to_uses.rb @@ -0,0 +1,5 @@ +class AddProfileCompletedToUses < ActiveRecord::Migration[5.2] + def change + add_column :users, :profile_completed, :boolean, default: false + end +end From 1f3ab3645d46e3c8d200caae088b1db1d3979aa2 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Sat, 22 Jun 2019 15:00:17 +0800 Subject: [PATCH 2/3] reset --- db/migrate/20190622065825_add_profile_completed_to_uses.rb | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 db/migrate/20190622065825_add_profile_completed_to_uses.rb diff --git a/db/migrate/20190622065825_add_profile_completed_to_uses.rb b/db/migrate/20190622065825_add_profile_completed_to_uses.rb deleted file mode 100644 index ef2cc2bf2..000000000 --- a/db/migrate/20190622065825_add_profile_completed_to_uses.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddProfileCompletedToUses < ActiveRecord::Migration[5.2] - def change - add_column :users, :profile_completed, :boolean, default: false - end -end From 620539b9247b47847171910730e4c88c7f60d8f7 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 22 Jun 2019 15:18:24 +0800 Subject: [PATCH 3/3] =?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/homework_commons_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index ec3f0ab9a..e4ed35b4b 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -173,8 +173,8 @@ class HomeworkCommonsController < ApplicationController end # 排序 - rorder = params[:order] || "update_time" - b_order = params[:b_order] || "desc" + rorder = params[:order].blank? ? "update_time" : params[:order] + b_order = params[:b_order].blank? ? "desc" : params[:b_order] if rorder == "update_time" || rorder == "work_score" @student_works = @student_works.order("student_works.#{rorder} #{b_order}") elsif rorder == "student_id"