TP5使用whereOr查询时致使部分查询条件失效怎么处理
$cusList = Db::table('cl_goods') ->where('status', '1')->where('ascription', $belong_to) ->where(function($query) {$query->where('goodsTitle','like',"***初%")->whereor('goodsTitle','like',"***中%");})->select();
->where(function($query) {$query->where('goodsTitle','like',"***初%")->whereor('goodsTitle','like',"***中%");})
/*这样就可以解决了*/
SELECT * FROM `cl_goods` WHERE `status` = '1' AND `ascription` = 'Clothingonline' AND ( `goodsTitle` LIKE '***初%' OR `goodsTitle` LIKE '***中%' )