语法
Db::table(表名)->where(条件)->select();
示例
$map['name'] = 'thinkphp'; $map['status'] = 1;// 把查询条件传入查询方法 Db::table('think_user')->where($map)->select();
对应原始sql
SELECT * FROM think_user WHERE `name`='thinkphp' AND status=1
转载于:https://blog.51cto.com/suyanzhu/1896468