tp5.0查询mongodb多条件报错

浏览:666 发布日期:2019/03/12 分类:求助交流 关键字: mongodb多条件查询
在列表页传到后台有多个条件,赋值到$where,然后再用链式操作 ->where($where),前台提示报错//$where
array(1) {
  [0]=>
  array(3) {
    [0]=>
    string(11) "goodsStatus"
    [1]=>
    string(1) "="
    [2]=>
    int(1)
  }
}
$this->model->table('mongodbGoods')->where($where)->select();
//报错查询表达式错误:goodsstatus
//mongodb中的goodsstatus是int型 我查询也转换成int型了
链式操作where()不能传数组吗?
$this->model->table('mongodbGoods')->where('goodsstatus','=',1)->select();
//这样就不报错
最佳答案
评论( 相关
后面还有条评论,点击查看>>