Skip to content

Commit

Permalink
改进column查询方法对别名的支持
Browse files Browse the repository at this point in the history
  • Loading branch information
liu21st committed Apr 26, 2020
1 parent 49014b9 commit 03aaaa4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/db/PDOConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -1151,6 +1151,8 @@ public function column(BaseQuery $query, string $column, string $key = ''): arra

if (strpos($column, ',')) {
$column = null;
} elseif (strpos($column, ' ')) {
$column = substr(strrchr(trim($column), ' '), 1);
} elseif (strpos($column, '.')) {
[$alias, $column] = explode('.', $column);
}
Expand Down

0 comments on commit 03aaaa4

Please sign in to comment.