From 2a208badfe7eb917c5c4916d65a9b35e18cc9e0c Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 12 Mar 2020 19:27:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E7=9A=84=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E5=8E=BB=E6=8E=89=E5=A4=96=E9=93=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/files_controller.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index 427545716..362523a7d 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -42,6 +42,10 @@ class FilesController < ApplicationController @unpublish_count = @total_count - @publish_count @attachments = @attachments.by_keywords(params[:search]) + if params[:no_link] + @attachments = @attachments.where(link: nil) + end + @attachments = @attachments.page(@page).per(@page_size) end