...
|
...
|
@@ -88,7 +88,7 @@ class CardController extends RestBaseController |
|
|
if($data['keyword']) {
|
|
|
$where = "SELECT `c`.`id`,`c`.`name`,`c`.`position`,`c`.`tel`,`c`.`home_tel`,`c`.`email`,`c`.`company`,`u`.`avatar`,IF(c.user_id='.$this->userId.',`c`.`user_id`,0) top FROM `bro_card` `c` LEFT JOIN `bro_user` `u` ON `c`.`user_id`=`u`.`id`
|
|
|
WHERE `c`.`is_recommend` = 1 AND ( `c`.`name` LIKE '%".$data['keyword']."%' OR `company` LIKE '%".$data['keyword']."%' OR `tel` LIKE '%".$data['keyword']."%' )
|
|
|
OR ( (`c`.`name` LIKE '%".$data['keyword']."%' OR `company` LIKE '%".$data['keyword']."%' OR `tel` LIKE '%".$data['keyword']."%') and `c`.`id` IN $ids)
|
|
|
OR ( (`c`.`name` LIKE '%".$data['keyword']."%' OR `company` LIKE '%".$data['keyword']."%' OR `tel` LIKE '%".$data['keyword']."%') and `c`.`id` IN ".$ids.")
|
|
|
ORDER BY top desc,c.create_time desc";
|
|
|
$result = Db::name('card')
|
|
|
->alias('c')
|
...
|
...
|
|