fix bug
This commit is contained in:
parent
57c28102e9
commit
6352ae7aa6
|
@ -428,7 +428,7 @@ class UsersController < ApplicationController
|
|||
|
||||
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
|
||||
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%>
|
||||
<%= show_activity @state%>
|
||||
<%= form_tag(:controller => 'users', :action => "show") do %>
|
||||
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% unless @state == 2%>
|
||||
<% unless @activity.empty? %>
|
||||
<%= show_activity @state%>
|
||||
<%= form_tag(:controller => 'users', :action => "show") do %>
|
||||
<div class="user-search-block" style="float:right;margin-top:-55px">
|
||||
<table width="100%" valign="center">
|
||||
<tr>
|
||||
<td align="right">
|
||||
<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">
|
||||
<% @activity.each do |e| %>
|
||||
<% act = e.act %>
|
||||
|
|
Loading…
Reference in New Issue