->all() 查询数据库中的全部信息,一对象形式返回
$rows=UserModel::all();
->get() 查询的执行函数,->toArray()将查询的是数据集转换成数组
$rows = UserModel::get()->toArray();
->Where() 表示条件查询,->first() 表示取出第一条数据
$user = UserModel::where("name","lee")->first();
$user = UserModel::where(['username'=>$username])->get()->toArray();
查询指定的字段:
$user = UserModel::where(['username'=>$username])->select(['id','username','passwords'])->get()->toArray();
->
->