MySQL
若想当where 条件为空时不走where条件,where可以整个为空,但里面的如where('is_status = s t a t u s ′ ) 的 status')的 status′)的status不能为空,不然会查询出status为空的数据,记录一下。
$where = '';
$sta = [];
$demandStatus = [];
if($status==0){
$sta['d.is_status'] = ['=',0];
$demandStatus['d.demand_status'] = ['=',0