设置不为空的查询写法,为空写成NULL即可
$where[] = ['t.status_time', 'EXP', Db::raw('IS NOT NULL')];
其他的二维数组查询写法
$where[] = ['t.pid', '=', 0];
$where[] = ['t.olddid', '=', $departmentId];
$where[] = ['needreply', '<>', 0];
$where[] = ['title|content', 'like', '%'.trim($param['keywords']).'%'];
$where[] = ['status', 'in', '20,40'];
时间相关的写法
$st = $param['starttime'].' 00:00:00';
$et = $param['endtime'].' 23:59:59';
$stime = strtotime($st);
$etime = strtotime($et);
$where[] = ['add_time', 'between time', [$stime,$etime]];
$st = $param['starttime'].' 00:00:00';
$stime = strtotime($st);
$where[] = ['add_time', '>=', $stime];