过后
This commit is contained in:
parent
bb14c2ece7
commit
accdd4c3dc
16
api/chat.php
16
api/chat.php
@ -242,15 +242,15 @@ if ($action === 'admin_get_all') {
|
||||
SUM(v.is_unread) as unread_count,
|
||||
MAX(v.has_recharge) as has_recharge,
|
||||
CASE
|
||||
WHEN m.message LIKE '<img%' THEN '[图片消息]'
|
||||
WHEN (m.message IS NULL OR m.message = '') AND MAX(v.has_recharge) = 1 THEN '[充值申请]'
|
||||
ELSE COALESCE(m.message, '新会话')
|
||||
WHEN MAX(m.message) LIKE '<img%' THEN '[图片消息]'
|
||||
WHEN (MAX(m.message) IS NULL OR MAX(m.message) = '') AND MAX(v.has_recharge) = 1 THEN '[充值申请]'
|
||||
ELSE COALESCE(MAX(m.message), '新会话')
|
||||
END as message,
|
||||
COALESCE(m.created_at, MAX(v.last_activity)) as created_at,
|
||||
COALESCE(u.username, u.email, CONCAT('访客 ', COALESCE(NULLIF(MAX(v.effective_ip), ''), '0.0.0.0'))) as username,
|
||||
IFNULL(u.uid, '---') as uid,
|
||||
IFNULL(u.registration_ip, '---') as registration_ip,
|
||||
IFNULL(r.remark, '') as remark,
|
||||
COALESCE(MAX(m.created_at), MAX(v.last_activity)) as created_at,
|
||||
COALESCE(MAX(u.username), MAX(u.email), CONCAT('访客 ', COALESCE(NULLIF(MAX(v.effective_ip), ''), '0.0.0.0'))) as username,
|
||||
IFNULL(MAX(u.uid), '---') as uid,
|
||||
IFNULL(MAX(u.registration_ip), '---') as registration_ip,
|
||||
IFNULL(MAX(r.remark), '') as remark,
|
||||
IFNULL(MAX(v.user_time), '---') as user_time
|
||||
FROM (
|
||||
SELECT
|
||||
|
||||
BIN
assets/pasted-20260222-083855-4141c55c.png
Normal file
BIN
assets/pasted-20260222-083855-4141c55c.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
@ -108,6 +108,13 @@ function ensureSchema() {
|
||||
}
|
||||
}
|
||||
|
||||
// --- messages table ---
|
||||
$stmt = $db->query("DESCRIBE messages");
|
||||
$columns = $stmt->fetchAll(PDO::FETCH_COLUMN);
|
||||
if (!in_array('is_read', $columns)) {
|
||||
$db->exec("ALTER TABLE messages ADD COLUMN is_read TINYINT(1) DEFAULT 0");
|
||||
}
|
||||
|
||||
// --- chat_visitors table ---
|
||||
$stmt = $db->query("SHOW INDEX FROM chat_visitors WHERE Key_name = 'session_id_unique'");
|
||||
if (!$stmt->fetch()) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user