Skip to content

Commit

Permalink
修正Mongodb的column方法
Browse files Browse the repository at this point in the history
  • Loading branch information
liu21st committed Jan 5, 2018
1 parent 3d3d133 commit a625837
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/db/connector/Mongo.php
Original file line number Diff line number Diff line change
Expand Up @@ -1262,8 +1262,8 @@ public function column(Query $query, $field, $key = '')
}

if (!$result) {
if (isset($options['field'])) {
$query->removeOption('field');
if (isset($options['projection'])) {
$query->removeOption('projection');
}

if ($key && '*' != $field) {
Expand All @@ -1274,7 +1274,7 @@ public function column(Query $query, $field, $key = '')
$field = array_map('trim', explode(',', $field));
}

$query->setOption('field', $field);
$query->field($field);

$mongoQuery = $this->builder->select($query);
// 执行查询操作
Expand Down

0 comments on commit a625837

Please sign in to comment.