Skip to content

Commit 535edd9

Browse files
committed
fix bug first row group change
1 parent c5c09c9 commit 535edd9

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/Detail.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,19 +102,20 @@ public function generate($obj = null) {
102102

103103
$arrayVariable = ($obj->arrayVariable) ? $obj->arrayVariable : array();
104104
$recordObject = array_key_exists('recordObj', $arrayVariable) ? $obj->arrayVariable['recordObj']['initialValue'] : "stdClass";
105-
$obj->lastRowData = $obj->rowData;
105+
$obj->lastRowData = $row;
106106
$row = ( is_array($dbData) || $dbData instanceOf \ArrayAccess ) ? (isset($dbData[$rowIndex])) ? $dbData[$rowIndex] : null : $dbData->fetchObject($recordObject);
107107
if (!is_object($row) && is_array($row)) {
108108
$row = (object)$row;
109109
}
110110
//echo $rowIndex;
111111
if (count($obj->arrayGroup) > 0) {
112112
foreach ($obj->arrayGroup as $group) {
113-
preg_match_all("/F{(\w+)}/", $group->groupExpression, $matchesF);
114-
$groupExpression = $matchesF[1][0];
115-
if ($obj->rowData->$groupExpression != $row->$groupExpression && $group->groupFooter) {
113+
$groupExpression = $obj->get_expression($group->groupExpression, $row);
114+
// preg_match_all("/F{(\w+)}/", $group->groupExpression, $matchesF);
115+
// $groupExpression = $matchesF[1][0];
116+
if ($obj->lastRowData->$groupExpression != $row->$groupExpression && $group->groupFooter) {
116117
$groupFooter = new GroupFooter($group->groupFooter);
117-
$groupFooter->generate(array($obj, $obj->rowData));
118+
$groupFooter->generate(array($obj, $row));
118119
$group->resetVariables = 'true';
119120
}
120121
}

0 commit comments

Comments
 (0)