public static function ***($data = null){
$where = [];
if($data['id']){
$where['id'] = $data['id'];
}
$list = Db::name('textbook')->where($where)->select();
dump($list);exit;
return $list;
}
会生成对应的sql语句,数据没有办法查出来,所以看了下日志中,对于sql的理解,变成了,这样
[ sql ] [ Mongo ] question_bank.qb_textbook.find({"$and":[{"id":"1"}]}); [ RunTime:0.000436s ]
感觉很不合理呢
如何能实现
db.qb_textook.find({id:1})这样的效果
最佳答案
