thinkphp中的or,like,in等联合查询
数据库中的两个字段有一个字段等于查询条件时,下面两个方法都是可以的:
(1) $where['a.goods_name|a.goods_sn'] = array('like',"%$keyWord%");
(2) $map['a.goods_name'] = array('like',$keyWordArrNew,'OR');
$map['a.goods_sn'] = array('like',$keyWordArrNew,'OR');
$map['_logic'] = 'or';
$where['_complex'] = $map;
补充一张thinkphp手册中的一张图片:
![](https://images2017.cnblogs.com/blog/1206439/201802/1206439-20180207181029029-189282541.png)