Skip to content

Commit c91df5a

Browse files
committed
修正游标查询时json字段未正确解析的问题
1 parent 312beac commit c91df5a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/db/PDOConnection.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,12 @@ public function getCursor(BaseQuery $query, string $sql, $model = null, $conditi
662662
// 返回结果集
663663
while ($result = $this->PDOStatement->fetch($this->fetchType)) {
664664
if ($model) {
665+
// JSON数据处理
666+
$options = $query->getOptions();
667+
if (!empty($options['json'])) {
668+
$query->jsonModelResult($result);
669+
}
670+
665671
yield $model->newInstance($result, $condition);
666672
} else {
667673
yield $result;

0 commit comments

Comments
 (0)