mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
改进
This commit is contained in:
@@ -769,7 +769,11 @@ class Query
|
||||
{
|
||||
if (empty($field)) {
|
||||
return $this;
|
||||
} elseif ($field instanceof Expression) {
|
||||
$this->options['field'][] = $field;
|
||||
return $this;
|
||||
}
|
||||
|
||||
if (is_string($field)) {
|
||||
$field = array_map('trim', explode(',', $field));
|
||||
}
|
||||
@@ -1485,7 +1489,13 @@ class Query
|
||||
*/
|
||||
public function order($field, $order = null)
|
||||
{
|
||||
if (!empty($field)) {
|
||||
if (empty($field)) {
|
||||
return $this;
|
||||
} elseif ($field instanceof Expression) {
|
||||
$this->options['order'][] = $field;
|
||||
return $this;
|
||||
}
|
||||
|
||||
if (is_string($field)) {
|
||||
if (!empty($this->options['via'])) {
|
||||
$field = $this->options['via'] . '.' . $field;
|
||||
@@ -1509,7 +1519,7 @@ class Query
|
||||
} else {
|
||||
$this->options['order'][] = $field;
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user