laravel orderBy problem?
PHPz
PHPz 2017-05-16 16:55:12
0
2
559

Laravel's orderBy('a','desc'), if I still want to sort b in descending order under the same situation as a, how should I write it

PHPz
PHPz

学习是最好的投资!

reply all (2)
大家讲道理

Write orderBy('b','desc') directly at the end;
You can use the ->toSql() method to view the executed sql statement for easy debugging.

    PHPzhong
    ->orderBy('a','desc')->orderBy('b','desc') //可以自己输出下sql看看 DB::connection()->enableQueryLog(); var_dump(DB::getQueryLog());
      Latest Downloads
      More>
      Web Effects
      Website Source Code
      Website Materials
      Front End Template
      About us Disclaimer Sitemap
      php.cn:Public welfare online PHP training,Help PHP learners grow quickly!