From 02681c4b25640a4e9cc52591cc10f3d1532e790e Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Wed, 12 Feb 2020 15:02:11 +0800 Subject: [PATCH 1/3] =?UTF-8?q?homepage=20=E9=87=8D=E5=A4=8D=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/queries/weapps/subject_query.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/queries/weapps/subject_query.rb b/app/queries/weapps/subject_query.rb index 0bf3e1e04..6ddd0b308 100644 --- a/app/queries/weapps/subject_query.rb +++ b/app/queries/weapps/subject_query.rb @@ -21,7 +21,7 @@ class Weapps::SubjectQuery < ApplicationQuery subjects = subjects.left_joins(:shixuns).select('subjects.id, subjects.name, subjects.excellent, subjects.stages_count, subjects.status, subjects.homepage_show, subjects.shixuns_count, subjects.updated_at, IFNULL(sum(shixuns.myshixuns_count), 0) myshixuns_count') - .group('subjects.id').order("(homepage_show, #{order_type}) #{sort_type}") + .group('subjects.id').order("(subjects.homepage_show, #{order_type}) #{sort_type}") subjects end From 382338cdf21be16a8db0c8708de6aa0127bcf0d0 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Wed, 12 Feb 2020 15:18:39 +0800 Subject: [PATCH 2/3] test --- app/queries/weapps/subject_query.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/queries/weapps/subject_query.rb b/app/queries/weapps/subject_query.rb index 6ddd0b308..8d8d693ab 100644 --- a/app/queries/weapps/subject_query.rb +++ b/app/queries/weapps/subject_query.rb @@ -21,7 +21,7 @@ class Weapps::SubjectQuery < ApplicationQuery subjects = subjects.left_joins(:shixuns).select('subjects.id, subjects.name, subjects.excellent, subjects.stages_count, subjects.status, subjects.homepage_show, subjects.shixuns_count, subjects.updated_at, IFNULL(sum(shixuns.myshixuns_count), 0) myshixuns_count') - .group('subjects.id').order("(subjects.homepage_show, #{order_type}) #{sort_type}") + .group('subjects.id').order("subjects.homepage_show #{sort_type}") subjects end From 9d10166665cb0f17a896a3900d5d9063b7fef4bc Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Wed, 12 Feb 2020 15:27:06 +0800 Subject: [PATCH 3/3] test --- app/queries/weapps/subject_query.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/queries/weapps/subject_query.rb b/app/queries/weapps/subject_query.rb index 8d8d693ab..4fb0053a0 100644 --- a/app/queries/weapps/subject_query.rb +++ b/app/queries/weapps/subject_query.rb @@ -21,7 +21,7 @@ class Weapps::SubjectQuery < ApplicationQuery subjects = subjects.left_joins(:shixuns).select('subjects.id, subjects.name, subjects.excellent, subjects.stages_count, subjects.status, subjects.homepage_show, subjects.shixuns_count, subjects.updated_at, IFNULL(sum(shixuns.myshixuns_count), 0) myshixuns_count') - .group('subjects.id').order("subjects.homepage_show #{sort_type}") + .group('subjects.id').order("(homepage_show #{sort_type}, #{order_type} #{sort_type})") subjects end