getBy方法以某字段为条件查询一条数据
$model->getBy('id',1); // 查询id为1的数据
执行的SQL语句:`select * from table where id=1`
你还可以这样用:
$model->getByID(5); // 查询id为5的数据
执行的SQL语句:`select * from table where id=5`
> getBy方法和selectBy不同的是,getBy只返回一条记录!

$model->getBy('id',1); // 查询id为1的数据
执行的SQL语句:`select * from table where id=1`
你还可以这样用:
$model->getByID(5); // 查询id为5的数据
执行的SQL语句:`select * from table where id=5`
> getBy方法和selectBy不同的是,getBy只返回一条记录!