refund_id字段的默认值null
那么tp3
$where['refund_id'] = array('exp','is null') 这种来
tp5
$where['refund_id'] = null
tp3
我一开始使用的是$where['refund_id'] = array('neq','null')
$where['refund_id'] = array('exp','not null') 这种是新发现的
tp5
OrderModel::where($map)->where('refund_id','not null')->count(); 直接使用 从下面手册找到如下
[NOT] NULL :
查询字段是否(不)是Null
,例如:
where('name', null);
where('title','null');
where('name','not null');
如果你需要查询一个字段的值为字符串null
或者not null
,应该使用: 这是查字符串的值
where('title','=', 'null');
where('name','=', 'not null');