From 284d2bcb60bc4a6f3f2ff7d58fc78f6afc9b6684 Mon Sep 17 00:00:00 2001 From: miroman-afk <74014189+miroman-afk@users.noreply.github.com> Date: Wed, 26 Jan 2022 20:56:40 +0300 Subject: [PATCH] v.2.8 -Redused time for online sync -Fix dish name for TopDishes --- commands/POSTRestoreShift.php | 2 +- commands/TopDishes.php | 9 ++++++++- composer.json | 2 +- module.ini | 4 ++-- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/commands/POSTRestoreShift.php b/commands/POSTRestoreShift.php index 95a219f..7992229 100644 --- a/commands/POSTRestoreShift.php +++ b/commands/POSTRestoreShift.php @@ -50,7 +50,7 @@ class POSTRestoreShift extends HRCCommand implements HRCCommandInterface { $baseTime = date_create($terminal_online['next_at']); $baseTime = date_format($baseTime, 'U'); $old_date = date_create($terminal_online['next_at']); - date_modify($old_date, '+1 hour'); + date_modify($old_date, '+30 minutes'); $new_date = date_format($old_date, 'Y-m-d H:i:s'); $newTime = $nowTime + ($terminal_online['period'] * 60); if ($newTime >= $baseTime) { diff --git a/commands/TopDishes.php b/commands/TopDishes.php index b040c2f..1ce6c8a 100644 --- a/commands/TopDishes.php +++ b/commands/TopDishes.php @@ -26,7 +26,14 @@ class TopDishes extends HRCCommand implements HRCCommandInterface { $onlineDishInfo = OnlineItems::where('menu_code', '=', $item['menu_code']) ->where('dish_code', '=', $item['dish_code']) ->first(); - $dishName = $dishInfo['name']; + if ($dishInfo['name'] == '') { + $dishHistInfo = Dishes::where('code', '=', $item['menu_code']) + ->where('legacy_code', '=', $item['dish_code']) + ->first(); + $dishName = $dishHistInfo['name']; + } else { + $dishName = $dishInfo['name']; + } $dishCount = OnlineItems::where('menu_code', '=', $item['menu_code'])->sum('count'); $dishSum = $onlineDishInfo['real_price'] * $dishCount; if ($dishSum > 0) { diff --git a/composer.json b/composer.json index c89a86b..a33af6d 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "hrc-admin/hello-world", - "version": "2.7", + "version": "2.8", "require": { "horeca/admin-php-module-core": "dev-master" }, diff --git a/module.ini b/module.ini index d386766..fcc44df 100644 --- a/module.ini +++ b/module.ini @@ -1,5 +1,5 @@ [info] name=V1 -version=2.7 +version=2.8 [build] -version=2.7 +version=2.8