$cus_where[] = ['is_del','=',0]; $cus_where[] = ['register_status','<>',1]; $cus_where[] = ['is_abandon','<>',1];
$map[] = ['company_name','=',$company_name]; $map[] = ['phone','=',$phone]; $customer_info = Db::name('customer_pool') ->where($cus_where) ->where(function($query) use ($map){$query->whereOr($map);}) ->find();
sql原生语句
SELECT * FROM `yuxi_customer_pool` WHERE `is_del` = 0 AND `register_status` <> 1 AND `is_abandon` <> 1 AND ( `company_name` = '大龄有限公司' OR `phone` = '15836875369' ) LIMIT 1