laraval框架 数据库 增删查改
2019-03-19 本文已影响0人
伟大的堂吉诃德
查询
$rs = User::where('account' , $request->account)
->where('password' , $request->password)
->first();
增添
$rs = User::create([
'account' => $request->account,
'password'=> $request->password
]);
删除
$rs = User::where('account' ,$request->id)
->delete();
修改
$rs ::where('account',2020 ) ->update(['$request->id' => 'account']);