fix report duplicate product fields
This commit is contained in:
@@ -346,6 +346,9 @@ class ReportsController
|
||||
if ($label === '') {
|
||||
continue;
|
||||
}
|
||||
if ($this->displayItemIndex($items, $label) !== null) {
|
||||
continue;
|
||||
}
|
||||
$this->appendDisplayItem(
|
||||
$items,
|
||||
$label,
|
||||
@@ -379,6 +382,17 @@ class ReportsController
|
||||
];
|
||||
}
|
||||
|
||||
private function displayItemIndex(array $items, string $label): ?int
|
||||
{
|
||||
foreach ($items as $index => $item) {
|
||||
if (($item['label'] ?? '') === $label) {
|
||||
return $index;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private function appendDisplayItem(array &$items, string $label, mixed $value, mixed $remark = '', bool $keepEmpty = false): void
|
||||
{
|
||||
$valueText = $this->textValue($value);
|
||||
|
||||
Reference in New Issue
Block a user