From 24b9ec488031948b84152cd272d4d4f17e89bdd4 Mon Sep 17 00:00:00 2001 From: qixinzhi Date: Tue, 21 May 2024 02:40:36 +0000 Subject: [PATCH] * Fix dtable colspan without slice,bug#48857. --- module/pivot/zen.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/module/pivot/zen.php b/module/pivot/zen.php index a1e80f765f..14971a1f11 100644 --- a/module/pivot/zen.php +++ b/module/pivot/zen.php @@ -189,9 +189,9 @@ class pivotZen extends pivot $index = 0; foreach($headerRow1 as $column) { - /* 如果 colspan 属性不为空则表示该列包含切片字段。*/ + /* 如果 colspan 属性不为空则且存在第二行表头表示该列包含切片字段。*/ /* If the colspan attribute is not empty, it means that the column contains slice fields. */ - if(!empty($column->colspan) && $column->colspan > 1) + if(!empty($column->colspan) && $column->colspan > 1 && !empty($headerRow2)) { /* 找到实际切片的字段。*/ /* Find the actual sliced field. */ @@ -233,6 +233,8 @@ class pivotZen extends pivot $columnMaxLen[$field] = mb_strlen($column->label); + if(isset($column->colspan) && $column->colspan > 1) $columns[$field]['colspan'] = $column->colspan; + // if(isset($data->groups[$index])) $columns[$field]['fixed'] = 'left'; $index++;