回复讨论(解决方案)
orderBy 方法(Builder.php)被写作
public function orderBy($column, $direction = 'asc') { $this->orders[] = compact('column', 'direction'); return $this; } 所以可以这样写
...->orderBy('a','desc')->orderBy('b','desc')->...
这样写应该也可以
...->orderBy(['a', 'b'], ['desc', 'desc'])->...
orderBy 方法(Builder.php)被写作
public function orderBy($column, $direction = 'asc') { $this->orders[] = compact('column', 'direction'); return $this; } 所以可以这样写
...->orderBy('a','desc')->orderBy('b','desc')->...
这样写应该也可以
...->orderBy(['a', 'b'], ['desc', 'desc'])->... 非常感谢,结贴给分!
orderBy 方法(Builder.php)被写作
public function orderBy($column, $direction = 'asc') { $this->orders[] = compact('column', 'direction'); return $this; } 所以可以这样写
...->orderBy('a','desc')->orderBy('b','desc')->...
这样写应该也可以
...->orderBy(['a', 'b'], ['desc', 'desc'])->... 非常感谢,结贴给分! 第二种方式貌似不行strtolower() expects parameter 1 to be string, array given,只能用第一种了。