if ( $nickname != '' ) {
$where .= " and CONCAT(a.nickname,a.mobile, a.card_number) like '%" . $nickname . "%'";
}
和
$where .= "and (a.nickname like '%{$nickname}%' or a.mobile like '%{$nickname}%' or a.card_number like '%{$nickname}%')";
的效果是一样的 明显上面的写法简单多了