From: Alexander Smirnov Date: Thu, 24 Apr 2025 13:34:58 +0000 (+0300) Subject: payment pretty print X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=b3bd6d37f347ffa325e65b25bf1cde12dc8cb83c;p=erp24_rep%2Fyii-erp24%2F.git payment pretty print --- 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) . '
';