* Fix display with summary when only one row in pivot.

This commit is contained in:
qixinzhi
2023-11-15 15:20:39 +08:00
parent b88eb7a1db
commit 769604ebd8
+5 -2
View File
@@ -1652,7 +1652,7 @@ class pivotModel extends model
$rowIndex = 0;
foreach($columnRows as $key => $row)
{
$count = $rowcount[$key];
$count = isset($rowcount[$key]) ? $rowcount[$key] : 1;
for($i = 0; $i < $count; $i++)
{
if(!isset($groupsRow[$rowIndex])) $groupsRow[$rowIndex] = new stdclass();
@@ -2267,14 +2267,17 @@ class pivotModel extends model
$table = "<table class='reportData table table-condensed table-striped table-bordered table-fixed datatable' style='width: auto; min-width: 100%' data-fixed-left-width='400'>";
$showOrigins = array();
$hasShowOrigin = false;
foreach($data->cols[0] as $col)
{
$colspan = zget($col, 'colspan', 1);
$colShowOrigin = array_fill(0, $colspan, $col->showOrigin);
$showOrigins = array_merge($showOrigins, $colShowOrigin);
if($col->showOrigin) $hasShowOrigin = true;
}
/* Init table thead. */
$table .= "<thead>";
foreach($data->cols as $lineCols)
@@ -2313,7 +2316,7 @@ class pivotModel extends model
$hidden = isset($configs[$i][$j]) ? false : (!$isGroup ? false : true);
$showOrigin = $showOrigins[$j];
if(!$isGroup && !$showOrigin)
if($hasShowOrigin && !$isGroup && !$showOrigin)
{
$rowspan = isset($configs[$i]) ? end($configs[$i]) : 1;
$hidden = isset($configs[$i]) ? false : true;