关于本站
“最难不过坚持”
本人承接扒站仿站,php网站维护,病毒查杀,网站编辑,网站改版,html制作
有需要网站维护,改版,病毒查杀,网站编辑,网站备案,html制作等相关的工作可以联系我。
本人有多年相关工作经验,也可提供免费咨询,交个朋友。
有需要探讨问题的朋友,也可以加我微信,共同探讨!
微信:15011482830 QQ:408917339
2344
35
分类目录
最新评论
- :weixiao:
-
- 有啥好的解决方法不 :weiqu:
-
- <script>alert(11)</script>
-
- :kaixin: :haha:
-
- 666 :kaixin:
-
文章标签更多
打开边栏(ESC)
关闭边栏(ESC)
总结如下:
//单一条件排序 $user = $this->where(['parentId'=>0)->field('userId,userName,userSort,isShow')->order('userSort', 'asc')->select(); //多个条件排序,可以多加一个order $user = $this->where(['parentId'=>0)->field('userId,userName,userSort,isShow')->order('userSort', 'asc')->order('userId', 'asc')->select(); //多个条件排序,还可以都写到order里面 $user = $this->where(['parentId'=>0)->field('userId,userName,userSort,isShow')->order('userSort', 'asc')->order('userSort asc,userId asc')->select();
thinkphp5.1官方文档order多字段排序
Db::table('think_user') ->where('status', 1) ->order(['order','id'=>'desc']) ->limit(5) ->select();网址https://www.kancloud.cn/manual/thinkphp5_1/354012
赏


相关推荐
TP 5 如何打开错误以及提示
打开config.php把app_debug设为true
tp5里面命名空间app修改
先来看下官方的解释
应用类库的根命名空间统一为app(不建议更改,可以设置app_namespace配置参数更改,V5.0.8版本开始使用APP_NAMESPACE常量定义);
例如:app\index\controller\Index和app\index\model\User。
注意:V5.0.8版本开始使用...
评论加载中...
前一篇: thinkPHP5 where多条件查询
后一篇: thinkphp5 怎么打印sql语句