From ef327f2994ce294fb8de489c221a3ca44202cd4b Mon Sep 17 00:00:00 2001 From: viletyy Date: Mon, 4 Jan 2021 16:19:11 +0800 Subject: [PATCH] [FIX] --- app/controllers/apply_signatures_controller.rb | 2 +- app/controllers/members_controller.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/apply_signatures_controller.rb b/app/controllers/apply_signatures_controller.rb index d2d3c044..81750a27 100644 --- a/app/controllers/apply_signatures_controller.rb +++ b/app/controllers/apply_signatures_controller.rb @@ -6,7 +6,7 @@ class ApplySignaturesController < ApplicationController def index @apply_signatures = @project.apply_signatures.with_status(status).includes(user: :user_extension) - @apply_signatures = @apply_signatures.joins(:user).where("LOWER(concat(users.lastname, users.firstname, users.login, users.mail)) LIKE ?", "%#{search.split(" ").join('|')}%") + @apply_signatures = @apply_signatures.joins(:user).where("LOWER(concat(users.lastname, users.firstname, users.login, users.mail, users.nickname)) LIKE ?", "%#{search.split(" ").join('|')}%") @apply_signatures = kaminari_paginate(@apply_signatures) end diff --git a/app/controllers/members_controller.rb b/app/controllers/members_controller.rb index 2964eb1a..b8c0ea54 100644 --- a/app/controllers/members_controller.rb +++ b/app/controllers/members_controller.rb @@ -18,7 +18,7 @@ class MembersController < ApplicationController scope = @project.members.includes(:roles, user: :user_extension) search = params[:search].to_s.downcase role = params[:role].to_s - scope = scope.joins(:user).where("LOWER(concat(users.lastname, users.firstname, users.login, users.mail)) LIKE ?", "%#{search.split(" ").join('|')}%") if search.present? + scope = scope.joins(:user).where("LOWER(concat(users.lastname, users.firstname, users.login, users.mail, users.nickname)) LIKE ?", "%#{search.split(" ").join('|')}%") if search.present? scope = scope.joins(:roles).where("roles.name LIKE ?", "%#{role}%") if role.present? @total_count = scope.size