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
学习是最好的投资!
Write orderBy('b','desc') directly at the end;You can use the ->toSql() method to view the executed sql statement for easy debugging.
->orderBy('a','desc')->orderBy('b','desc') //可以自己输出下sql看看 DB::connection()->enableQueryLog(); var_dump(DB::getQueryLog());
Write orderBy('b','desc') directly at the end;
You can use the ->toSql() method to view the executed sql statement for easy debugging.