From 71a8d67515cb4176aaa9af3e099e8b6fdf215729 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Fri, 17 Jan 2025 10:43:31 +0800 Subject: [PATCH] =?UTF-8?q?fixed:=20=E6=9C=AA=E5=88=86=E7=B1=BB=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/action/nodes_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/action/nodes_controller.rb b/app/controllers/action/nodes_controller.rb index c995513da..a891b2a29 100644 --- a/app/controllers/action/nodes_controller.rb +++ b/app/controllers/action/nodes_controller.rb @@ -5,7 +5,9 @@ class Action::NodesController < ApplicationController def index @node_types = Action::NodeType.all + no_node_type = Action::NodeType.find_by(name: "未分类") @no_type_nodes = Action::Node.where(action_node_types_id: nil) + @no_type_nodes = Action::Node.where(action_node_types_id: nil).or(where(action_node_types_id: no_node_type.id)) if no_node_type.present? respond_to do |format| format.html { @nodes = Action::Node.where("name LIKE :search OR full_name LIKE :search", :search => "%#{params[:search]}%") } format.json