From 5493ca53304d4cf1963c35cee5bdf6103d7596a0 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sat, 17 Aug 2019 13:48:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E8=8D=90=E5=AE=9E=E8=AE=AD=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 3 ++- app/views/attachments/_attachment.json.jbuilder | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 099d45406..142ca6d75 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -52,7 +52,8 @@ module ApplicationHelper shixun_id = shixun_id.blank? ? -1 : shixun_id.join(",") Shixun.select([:id, :name, :user_id, :challenges_count, :myshixuns_count, :trainee, :identifier]).where("id - in(#{shixun_id}) or homepage_show =1").unhidden.order("myshixuns_count desc, homepage_show asc").limit(3) + in(#{shixun_id})").unhidden.order("homepage_show asc, myshixuns_count desc").limit(3) + end # 相关推荐 diff --git a/app/views/attachments/_attachment.json.jbuilder b/app/views/attachments/_attachment.json.jbuilder index 01a7f4163..52f16c549 100644 --- a/app/views/attachments/_attachment.json.jbuilder +++ b/app/views/attachments/_attachment.json.jbuilder @@ -10,4 +10,4 @@ json.quotes attachment.quotes_count json.description attachment.description json.downloads_count attachment.downloads_count json.created_on attachment.created_on -json.url download_url(attachment) unless attachment.locked?(@is_member) +json.url download_url(attachment)