Query类的order方法支持多次调用合并

This commit is contained in:
thinkphp
2016-12-23 14:47:28 +08:00
parent c33cc2991b
commit 2c03514d98

View File

@@ -1181,7 +1181,14 @@ class Query
}
}
}
$this->options['order'] = $field;
if (!isset($this->options['order'])) {
$this->options['order'] = [];
}
if (is_array($field)) {
$this->options['order'] = array_merge($this->options['order'], $field);
} else {
$this->options['order'][] = $field;
}
}
return $this;
}