• <legend id='8BpnK'><style id='8BpnK'><dir id='8BpnK'><q id='8BpnK'></q></dir></style></legend>

    1. <i id='8BpnK'><tr id='8BpnK'><dt id='8BpnK'><q id='8BpnK'><span id='8BpnK'><b id='8BpnK'><form id='8BpnK'><ins id='8BpnK'></ins><ul id='8BpnK'></ul><sub id='8BpnK'></sub></form><legend id='8BpnK'></legend><bdo id='8BpnK'><pre id='8BpnK'><center id='8BpnK'></center></pre></bdo></b><th id='8BpnK'></th></span></q></dt></tr></i><div id='8BpnK'><tfoot id='8BpnK'></tfoot><dl id='8BpnK'><fieldset id='8BpnK'></fieldset></dl></div>

          <bdo id='8BpnK'></bdo><ul id='8BpnK'></ul>
        <tfoot id='8BpnK'></tfoot>

        <small id='8BpnK'></small><noframes id='8BpnK'>

      1. Yii2:如何在 Find() 的 orderby() 中添加两个字段

        时间:2023-10-16
          <bdo id='v6qNM'></bdo><ul id='v6qNM'></ul>
            • <i id='v6qNM'><tr id='v6qNM'><dt id='v6qNM'><q id='v6qNM'><span id='v6qNM'><b id='v6qNM'><form id='v6qNM'><ins id='v6qNM'></ins><ul id='v6qNM'></ul><sub id='v6qNM'></sub></form><legend id='v6qNM'></legend><bdo id='v6qNM'><pre id='v6qNM'><center id='v6qNM'></center></pre></bdo></b><th id='v6qNM'></th></span></q></dt></tr></i><div id='v6qNM'><tfoot id='v6qNM'></tfoot><dl id='v6qNM'><fieldset id='v6qNM'></fieldset></dl></div>
                  <tbody id='v6qNM'></tbody>

                <tfoot id='v6qNM'></tfoot>

                <small id='v6qNM'></small><noframes id='v6qNM'>

                  <legend id='v6qNM'><style id='v6qNM'><dir id='v6qNM'><q id='v6qNM'></q></dir></style></legend>

                  本文介绍了Yii2:如何在 Find() 的 orderby() 中添加两个字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  如何在find()方法中添加多个字段进行排序?

                  How to add more than one field to sort in find() method?

                  我尝试过如下

                  $model::find()->orderBy([['id_date' => SORT_DESC],['item_no'=>SORT_ASC]);
                  

                  但是它在查询时抛出错误.yii2 产生的 Orderby Query 为:ORDER BY 0, 1

                  But it is throwing error with query. Orderby Query produced by yii2 is: ORDER BY 0, 1

                  推荐答案

                  根据文档:

                  $model::find()->orderBy([
                    'id_date' => SORT_DESC,
                    'item_no'=>SORT_ASC
                  ]);
                  

                  这篇关于Yii2:如何在 Find() 的 orderby() 中添加两个字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Yii2 动态 URL 路由规则 下一篇:Yii2 cors 过滤错误,即不存在“Access-Control-Allow-Origin"标头

                  相关文章

                    <tfoot id='3IlA6'></tfoot>

                      <small id='3IlA6'></small><noframes id='3IlA6'>

                      <legend id='3IlA6'><style id='3IlA6'><dir id='3IlA6'><q id='3IlA6'></q></dir></style></legend>
                        <bdo id='3IlA6'></bdo><ul id='3IlA6'></ul>
                      <i id='3IlA6'><tr id='3IlA6'><dt id='3IlA6'><q id='3IlA6'><span id='3IlA6'><b id='3IlA6'><form id='3IlA6'><ins id='3IlA6'></ins><ul id='3IlA6'></ul><sub id='3IlA6'></sub></form><legend id='3IlA6'></legend><bdo id='3IlA6'><pre id='3IlA6'><center id='3IlA6'></center></pre></bdo></b><th id='3IlA6'></th></span></q></dt></tr></i><div id='3IlA6'><tfoot id='3IlA6'></tfoot><dl id='3IlA6'><fieldset id='3IlA6'></fieldset></dl></div>