Fix Telegram bot notifications and list

This commit is contained in:
Matteo Gheza 2022-01-12 21:11:39 +01:00
parent 4c4019812c
commit 9056414969
2 changed files with 4 additions and 4 deletions

View File

@ -97,9 +97,9 @@ function apiRouter (FastRoute\RouteCollector $r) {
requireLogin() || accessDenied();
$users->online_time_update();
if($users->hasRole(Role::FULL_VIEWER)) {
$response = $db->select("SELECT * FROM `".DB_PREFIX."_profiles` WHERE `hidden` = 0 ORDER BY available DESC, chief DESC, services ASC, trainings DESC, availability_minutes DESC, name ASC");
$response = $db->select("SELECT * FROM `".DB_PREFIX."_profiles` WHERE `hidden` = 0 ORDER BY available DESC, chief DESC, services ASC, trainings DESC, availability_minutes ASC, name ASC");
} else {
$response = $db->select("SELECT `id`, `chief`, `online_time`, `available`, `availability_minutes`, `name`, `driver`, `services` FROM `".DB_PREFIX."_profiles` WHERE `hidden` = 0 ORDER BY available DESC, chief DESC, services ASC, trainings DESC, availability_minutes DESC, name ASC");
$response = $db->select("SELECT `id`, `chief`, `online_time`, `available`, `availability_minutes`, `name`, `driver`, `services` FROM `".DB_PREFIX."_profiles` WHERE `hidden` = 0 ORDER BY available DESC, chief DESC, services ASC, trainings DESC, availability_minutes ASC, name ASC");
}
apiResponse(
!is_null($response) ? $response : []

View File

@ -68,9 +68,9 @@ function sendTelegramNotification($message)
"text" => $message
]);
$db->update(
"`".DB_PREFIX."_bot_telegram_notifications`",
DB_PREFIX."_bot_telegram_notifications",
["last_notification" => $message],
["id" => $chat["id"]]
["chat_id" => $chat]
);
}
}