public function orm(){
//查询表的所有记录
//$user = Admin::all();
//dd($user);
//查询某一条记录
//$user = Admin::find(2);
//dd($user);
//findOrFail() 根据主键查找,如果没有找到就抛出异常
//$user = Admin::findOrFail(1);
//dd($user);
//查询所有记录
//$user = Admin::get();
//dd($user);
//增加条件查询
//$user = Admin::where('uid','>=',4)->orderBy('uid','desc')->first();
//分段查询
//Admin::chunk(2,function($user){
//var_dump($user);
//});
//聚合函数
//获取记录的条数
//$count = Admin::count();
//dd($count);
//获取最大值
//$max = Admin::where('uid','>=',5)->max('age');
//使用模型新增数据
//$user = new Admin();
//$user-> username = 'haha';
//$bool = $user->save();
//dd($bool);
//获取时间
//$user = Admin::find(1);
//echo date('Y-m-d H:i:s',$user->create_at);
//使用模型的Create方法新增数据
//$user = Admin::create(['username'=>'meimei']);
//dd($user);
//以属性查找用户,如果没有则新增
//$user = Admin::firstOrCreate(['username'=>'imooc']);
//dd($user);
//以属性查找用户,如果没有则新增,但不保存到数据库
//$user = Admin::firstOrNew(['username'=>'imooc']);
//dd($user);
//通过模型更新数据
//$user = Admin::find(1);
//$user->username = 'jack';
//$bool = $user->save();
//dd($bool);
//增加条件
//$num = Admin::where('id','>','1')->update(['age'=>21]);
//dd($num);
//通过模型删除
//$user = Admin::find(6);
//$bool = $user->delete();
//dd($bool);
//通过主键删除
//$num = Admin::destroy(6);
//dd($num);
//删除多条记录
//$num = Admin::destroy(1,2,3);
//$num = Admin::destroy([1,2,3]);
//dd($num);
//增加条件的删除操作
//$num = Admin::where('uid','>','4')->delete();
//dd($num);
}