回复讨论(解决方案) 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,只能用第一种了。
