Фиксили телеграф, немного дописали чат...
This commit is contained in:
+7
-7
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user