Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
andruha committed Apr 8, 2016
1 parent 84c5d60 commit bbb6a93
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ActiveQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -417,15 +417,15 @@ private function findByPk($db, $type, $columnName = null)
case 'Column':
$column = [];
foreach ($data as $dataRow) {
$row = $this->parseList($dataRow);
$row = $this->parseRow($dataRow);
$column[] = $row[$columnName];
}

return $column;
case 'Sum':
$sum = 0;
foreach ($data as $dataRow) {
$row = $this->parseList($dataRow);
$row = $this->parseRow($dataRow);
$sum += $row[$columnName];
}

Expand All @@ -435,15 +435,15 @@ private function findByPk($db, $type, $columnName = null)
$count = 0;
foreach ($data as $dataRow) {
$count++;
$row = $this->parseList($dataRow);
$row = $this->parseRow($dataRow);
$sum += $row[$columnName];
}

return $sum / $count;
case 'Min':
$min = null;
foreach ($data as $dataRow) {
$row = $this->parseList($dataRow);
$row = $this->parseRow($dataRow);
if ($min == null || $row[$columnName] < $min) {
$min = $row[$columnName];
}
Expand All @@ -453,7 +453,7 @@ private function findByPk($db, $type, $columnName = null)
case 'Max':
$max = null;
foreach ($data as $dataRow) {
$row = $this->parseList($dataRow);
$row = $this->parseRow($dataRow);
if ($max == null || $row[$columnName] > $max) {
$max = $row[$columnName];
}
Expand Down

0 comments on commit bbb6a93

Please sign in to comment.