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
大家讲道理2017-05-16 16:57:12
Write orderBy('b','desc') directly at the end;
You can use the ->toSql() method to view the executed sql statement for easy debugging.
PHPz2017-05-16 16:57:12
->orderBy('a','desc')->orderBy('b','desc')
//可以自己输出下sql看看
DB::connection()->enableQueryLog();
var_dump(DB::getQueryLog());