fix bug
This commit is contained in:
parent
57c28102e9
commit
6352ae7aa6
|
@ -428,7 +428,7 @@ class UsersController < ApplicationController
|
||||||
|
|
||||||
if params[:user].present?
|
if params[:user].present?
|
||||||
|
|
||||||
user_temp = User.find_by_sql("select id from users where firstname like '%#{params[:user]}%' or lastname like '%#{params[:user]}%'")
|
user_temp = User.find_by_sql("select id from users where concat(lastname,firstname) like '%#{params[:user]}%' or lastname like '%#{params[:user]}%'")
|
||||||
|
|
||||||
if user_temp.size > 1
|
if user_temp.size > 1
|
||||||
activity = Activity.where('user_id in (?)', user_temp).where('user_id in (?)', watcher).order('id desc')
|
activity = Activity.where('user_id in (?)', user_temp).where('user_id in (?)', watcher).order('id desc')
|
||||||
|
|
|
@ -1,11 +1,21 @@
|
||||||
<% if User.current.id == @user.id%>
|
<% if User.current.id == @user.id%>
|
||||||
<%= show_activity @state%>
|
<%= show_activity @state%>
|
||||||
<%= form_tag(:controller => 'users', :action => "show") do %>
|
<%= form_tag(:controller => 'users', :action => "show") do %>
|
||||||
|
<div class="user-search-block" style="float:right;margin-top:-55px">
|
||||||
<% end %>
|
<table width="100%" valign="center">
|
||||||
<% end %>
|
<tr>
|
||||||
<% unless @state == 2%>
|
<td align="right">
|
||||||
<% unless @activity.empty? %>
|
<div class="project-search">
|
||||||
|
<%= text_field_tag 'user', params[:user], :size => 30 %>
|
||||||
|
<%= submit_tag l(:label_search_by_user), :class => "small", :name => nil %>
|
||||||
|
</div></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% unless @state == 2%>
|
||||||
|
<% unless @activity.empty? %>
|
||||||
<div id="activity">
|
<div id="activity">
|
||||||
<% @activity.each do |e| %>
|
<% @activity.each do |e| %>
|
||||||
<% act = e.act %>
|
<% act = e.act %>
|
||||||
|
|
Loading…
Reference in New Issue