数据读取
从数据库读取数据
读取多条记录
//读取所有记录
$list = table('users')->all();
//根据条件读取多条记录
$list = table('product')->where("color='red'")->select()
//根据条件读取多条记录后分页
$list = table('product')->where("size='L'")->page()
读取单条记录
//Id为1的用户信息
$info = table('users')->get(1);
//颜色为white的最近添加的一条记录
$info = table('product')->where("color='white'")->order("create_time desc")->find();
//最近添加的一条记录
$info = table('product')->order("id desc")->get();
//尺寸为M的所有Id的列表,返回数组
$info = table('product')->where("size='M'")->value('id');
//尺寸为L的总数
$count = table('product')->where("size='L'")->count('*')->value();