当一个非常简单的查询,我们直接这样写就可以了。
$where = [];
$where['status'] = 1;
$lst = $this->where($where)->select();
如何涉及到比较复杂的查询,有in这样的嵌套查询,那么就必须这样写。
$where = [];
$where[] = ['memberid','=',$uid];
$where[] = ['itemid','in',$cartIds];
$lst = $this->where($where)->select();
备注:$cartIds 是一个字符串。