fix report duplicate product fields
This commit is contained in:
@@ -346,6 +346,9 @@ class ReportsController
|
|||||||
if ($label === '') {
|
if ($label === '') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if ($this->displayItemIndex($items, $label) !== null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$this->appendDisplayItem(
|
$this->appendDisplayItem(
|
||||||
$items,
|
$items,
|
||||||
$label,
|
$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
|
private function appendDisplayItem(array &$items, string $label, mixed $value, mixed $remark = '', bool $keepEmpty = false): void
|
||||||
{
|
{
|
||||||
$valueText = $this->textValue($value);
|
$valueText = $this->textValue($value);
|
||||||
|
|||||||
Reference in New Issue
Block a user