mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 15:12:48 +08:00
修整db->Driver中order解析方法
This commit is contained in:
@@ -736,8 +736,8 @@ abstract class Driver
|
|||||||
*/
|
*/
|
||||||
protected function parseOrder($order)
|
protected function parseOrder($order)
|
||||||
{
|
{
|
||||||
$array = [];
|
|
||||||
if (is_array($order)) {
|
if (is_array($order)) {
|
||||||
|
$array = [];
|
||||||
foreach ($order as $key => $val) {
|
foreach ($order as $key => $val) {
|
||||||
if (is_numeric($key)) {
|
if (is_numeric($key)) {
|
||||||
if (false === strpos($val, '(')) {
|
if (false === strpos($val, '(')) {
|
||||||
@@ -750,8 +750,8 @@ abstract class Driver
|
|||||||
$array[] = $this->parseKey($key) . ' ' . $sort;
|
$array[] = $this->parseKey($key) . ' ' . $sort;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$order = implode(',', $array);
|
||||||
}
|
}
|
||||||
$order = implode(',', $array);
|
|
||||||
return !empty($order) ? ' ORDER BY ' . $order : '';
|
return !empty($order) ? ' ORDER BY ' . $order : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user