Fix Telegram bot notifications and list
This commit is contained in:
parent
4c4019812c
commit
9056414969
|
@ -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 : []
|
||||
|
|
|
@ -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]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue