修复作业列表搜索bug
This commit is contained in:
parent
775ebc3607
commit
583c022048
|
@ -427,11 +427,13 @@ class UsersController < ApplicationController
|
|||
end
|
||||
|
||||
if params[:user].present?
|
||||
|
||||
user_temp = User.find_by_sql("select id from users where firstname like '%#{params[:user]}%' or lastname like '%#{params[:user]}%'")
|
||||
|
||||
if user_temp.size > 1
|
||||
activity = Activity.where('user_id in (?)', user_temp).order('id desc')
|
||||
activity = Activity.where('user_id in (?)', user_temp).where('user_id in (?)', watcher).order('id desc')
|
||||
elsif user_temp.size == 1
|
||||
activity = Activity.where('user_id = ?', user_temp).order('id desc')
|
||||
activity = Activity.where('user_id = ?', user_temp).where('user_id in (?)', watcher).order('id desc')
|
||||
else
|
||||
activity = Activity.where("1 = 0")
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue