Yii2 ActiveDataProvider 默认数据排序

  • A+
所属分类:脚本开发
摘要

Yii2 ActiveDataProvider 默认数据排序

修改$dataProvider为:

$dataProvider = new ActiveDataProvider([
            'query' => $query,
            'sort' => [
                'defaultOrder' => [
                    'date' => SORT_DESC,            
                ]
            ],
        ]);

 

  • 免费优惠券
  • 免费领取优惠券
  • weinxin
  • 支付宝红包领取
  • 支付宝大额红包
  • weinxin

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

关闭震动