Фиксили телеграф, немного дописали чат...

This commit is contained in:
lopar
2021-02-01 03:39:50 +02:00
parent da410d57c8
commit 7fa1720c40
2 changed files with 36 additions and 32 deletions
+7 -7
View File
@@ -925,17 +925,17 @@ function err($t)
/**
* @param $name
* @param $text
* @param int $userId
* @param string $text
*
* @throws \Krugozor\Database\Mysql\Exception
*/
function telegraph($userId, $text)
function telegraph(int $userId, string $text)
{
db::c()->query('SELECT 1 FROM `users` WHERE `id` = ?i', $userId)->fetch_assoc();
if (db::c()->getAffectedRows()) {
db::c()->query('INSERT INTO `telegraph` (receiver, text) VALUES (?i,"?s")', $userId, $text);
$db = DBPDO::INIT();
if ($db->ofetch('SELECT 1 FROM users WHERE id = ?', $userId)) {
$db->execute('INSERT INTO chat (user_id,receiver_id,msg,type) VALUES (-1,?,?,?)', [$userId, $text, 'sms']);
}
unset($db);
}
function get_meshok()