www.bdxw.net > lArAvEl All orDErBy

lArAvEl All orDErBy

直接在后面加上另一个orderBy就行了。例如 User::orderBy('name', 'DESC') ->orderBy('email', 'ASC') ->get(); 会产生这样的sql语句效果: SELECT * FROM `users` ORDER BY `name` DESC, `email` ASC

select from yourtables where and name not in('') 括号你不要的列

区别与应用: Form中的get和post方法,在数据传输过程中分别对应了HTTP协议中的GET和POST方法。

$res= User::where('username','like', "%$name%")->orderby('id','desc')->paginate(15);

网站地图

All rights reserved Powered by www.bdxw.net

copyright ©right 2010-2021。
www.bdxw.net内容来自网络,如有侵犯请联系客服。zhit325@qq.com