From bd66c0947e2dc20ccbf352fcd5b8329fc73ea38a Mon Sep 17 00:00:00 2001 From: Aleksey Filippov Date: Sat, 20 Jul 2024 16:35:00 +0300 Subject: [PATCH] =?utf8?q?[ERP-117]=20=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B8?= =?utf8?q?=20=D0=BF=D0=BE=20=D0=B2=D1=8B=D0=B2=D0=BE=D0=B4=D1=83=20=D1=81?= =?utf8?q?=D0=BE=D1=82=D1=80=D1=83=D0=B4=D0=BD=D0=B8=D0=BA=D0=BE=D0=B2=20?= =?utf8?q?=D0=B2=20=D0=BB=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/services/CabinetService.php | 7 +++++-- erp24/web/index.php | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/erp24/services/CabinetService.php b/erp24/services/CabinetService.php index 81c0b123..ccc1a9ce 100755 --- a/erp24/services/CabinetService.php +++ b/erp24/services/CabinetService.php @@ -4143,9 +4143,12 @@ Group BY admin_id foreach ($timetableFactPrepared as $key => $row) { if (!array_key_exists($row['date_shift'], $listDateCount)) { $listDateCount[$row['date_shift']] = 1; - $timetableFact[$key] = $row; - $timetableFact[$key]['date'] = $row['date_shift']; + + } else { + $listDateCount[$row['date_shift']] = $listDateCount[$row['date_shift']] + 1; } + $timetableFact[$key] = $row; + $timetableFact[$key]['date'] = $row['date_shift']; } } diff --git a/erp24/web/index.php b/erp24/web/index.php index 7c88b094..a32daaef 100644 --- a/erp24/web/index.php +++ b/erp24/web/index.php @@ -32,7 +32,7 @@ if ( $post = \yii\helpers\Json::encode($postJson); $post = str_replace('"', '\'', $post); $app->db->createCommand( - 'INSERT INTO page_statistics (admin_id, url, post, created_at) VALUES (\'' . $_SESSION['admin_id'] . '\', \'' + 'INSERT INTO public.page_statistics (admin_id, url, post, created_at) VALUES (\'' . $_SESSION['admin_id'] . '\', \'' . $url . '\', :post, NOW())' )->bindParam(':post', $post, PDO::PARAM_STR)->execute(); } -- 2.39.5