up
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/../config/config_enhanced.php';
|
||||
$db = Database::getInstance();
|
||||
|
||||
// Get an existing user_id (user of conversations)
|
||||
$user = $db->fetch('SELECT id, phone_number FROM users LIMIT 1');
|
||||
$userId = $user['id'] ?? null;
|
||||
|
||||
$data = [
|
||||
'user_id' => $userId,
|
||||
'type' => 'message',
|
||||
'message' => 'Prueba: nuevo mensaje recibido',
|
||||
'data' => json_encode(['phone' => $user['phone_number'] ?? '']),
|
||||
'is_read' => 0,
|
||||
'created_at' => date('Y-m-d H:i:s')
|
||||
];
|
||||
|
||||
$id = $db->insert('notifications', $data);
|
||||
if ($id) {
|
||||
echo "Inserted notification id=$id for user_id={$userId}\n";
|
||||
} else {
|
||||
echo "Failed to insert notification\n";
|
||||
}
|
||||
Reference in New Issue
Block a user