From b3bd6d37f347ffa325e65b25bf1cde12dc8cb83c Mon Sep 17 00:00:00 2001 From: Alexander Smirnov Date: Thu, 24 Apr 2025 16:34:58 +0300 Subject: [PATCH] payment pretty print --- erp24/modul/sales_checks/index.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/erp24/modul/sales_checks/index.php b/erp24/modul/sales_checks/index.php index acdfada8..bf3d0b34 100644 --- a/erp24/modul/sales_checks/index.php +++ b/erp24/modul/sales_checks/index.php @@ -115,7 +115,15 @@ if(!empty($row["phone"])) echo'бонусная '.$row["payments"].' +$decodedJson = json_decode($row["payments"], true); +$out = ''; +if ($decodedJson === null && json_last_error() !== JSON_ERROR_NONE) { + $out = 'Ошибка в JSON'; +} else { + $out = json_encode($decodedJson, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE); +} + +echo'
'.\yii\helpers\Html::tag('pre', $out) . '
'; -- 2.39.5