Update quantity

This commit is contained in:
Krzysztof Płaczek
2024-11-10 17:58:21 +01:00
parent a0a1dac4c7
commit 499e14de45

View File

@@ -53,7 +53,7 @@ foreach ($receivers as $receiver) {
touch('last_notification_date.txt'); touch('last_notification_date.txt');
} }
$lastNotificationDate = file_get_contents('last_notification_date.txt'); $lastNotificationDate = file_get_contents('last_notification_date.txt');
if ($packageInfo['current_quantity'] > -1 && $lastNotificationDate !== date('Y-m-d')) { if ($packageInfo['current_quantity'] > 0 && $lastNotificationDate !== date('Y-m-d')) {
send_notifications($client, $receiver, 'Dostępna paczka w 3 kromki chleba', sprintf('W trzech kromkach dostępne są paczki. Ilość: %s', $packageInfo['current_quantity'])); send_notifications($client, $receiver, 'Dostępna paczka w 3 kromki chleba', sprintf('W trzech kromkach dostępne są paczki. Ilość: %s', $packageInfo['current_quantity']));
$notificationSent = true; $notificationSent = true;
} }