姓名搜索时同时搜索用户名

This commit is contained in:
wlx 2011-10-10 08:03:54 +00:00
parent 1c6b29f20e
commit c5712b84dc
1 changed files with 5 additions and 2 deletions

View File

@ -59,8 +59,11 @@ class Admin_UserController extends Zend_Controller_Action
{
$this->messenger->addMessage('搜索结果');
$select->from('users');
if(!empty($realname))
$select->where('realname like ? ', '%'.$realname.'%');
if(!empty($realname))
{
$select->where('realname like ? ', '%'.$realname.'%');
$select->orWhere('username like ? ', '%'.$realname.'%');
}
if(!empty($unit))
$select->where('unit like ? ', '%'.$unit.'%');
if(!empty($project))