mirror of
https://github.com/Mibew/mibew.git
synced 2025-02-07 16:24:43 +03:00
Lowercase database columns names
This commit is contained in:
parent
bdd7d31bd5
commit
f33c686aab
@ -25,13 +25,13 @@ chatthread:
|
||||
# ID of the thread.
|
||||
threadid: "int NOT NULL auto_increment PRIMARY KEY"
|
||||
# Name of the user in chat.
|
||||
userName: "varchar(64) NOT NULL"
|
||||
username: "varchar(64) NOT NULL"
|
||||
# ID of the user. This field is foreign key for {chatsitevisitor}.userid
|
||||
userid: "varchar(255)"
|
||||
# Name of the operator who took place in the chat.
|
||||
agentName: "varchar(64)"
|
||||
agentname: "varchar(64)"
|
||||
# ID of the operator who took place in the chat.
|
||||
agentId: "int NOT NULL DEFAULT 0"
|
||||
agentid: "int NOT NULL DEFAULT 0"
|
||||
# Unix timestamp of the moment when the thread was created.
|
||||
dtmcreated: "int NOT NULL DEFAULT 0"
|
||||
# Unix timestamp of the moment when chat actually started.
|
||||
@ -62,15 +62,15 @@ chatthread:
|
||||
# Unix timestamp of the last request from operator's window to server.
|
||||
lastpingagent: "int NOT NULL DEFAULT 0"
|
||||
# Indicates if user typing or not. It can take two values 0 and 1.
|
||||
userTyping: "int DEFAULT 0"
|
||||
usertyping: "int DEFAULT 0"
|
||||
# Indicates if operator typing or not. It can take two values 0 and 1.
|
||||
agentTyping: "int DEFAULT 0"
|
||||
agenttyping: "int DEFAULT 0"
|
||||
# ID of shown message in the chat.
|
||||
shownmessageid: "int NOT NULL DEFAULT 0"
|
||||
# User agent description that took from 'User-Agent' HTTP header.
|
||||
userAgent: "varchar(255)"
|
||||
useragent: "varchar(255)"
|
||||
# Total count of user's messages related with the thread.
|
||||
messageCount: "varchar(16)"
|
||||
messagecount: "varchar(16)"
|
||||
# ID of the group at Mibew side related with the thread.
|
||||
groupid: "int references {chatgroup}(groupid)"
|
||||
|
||||
@ -152,7 +152,7 @@ chatmessage:
|
||||
ikind: "int NOT NULL"
|
||||
# ID of operator who sent the message. This value will be ignored for
|
||||
# system messages and messages which sent by users.
|
||||
agentId: "int NOT NULL DEFAULT 0"
|
||||
agentid: "int NOT NULL DEFAULT 0"
|
||||
# Message text body.
|
||||
tmessage: "text NOT NULL"
|
||||
# Name of the plugin which sent the message. If message was not sent by
|
||||
@ -226,7 +226,7 @@ chatban:
|
||||
dtmtill: "int NOT NULL DEFAULT 0"
|
||||
address: "varchar(255)"
|
||||
comment: "varchar(255)"
|
||||
blockedCount: "int DEFAULT 0"
|
||||
blockedcount: "int DEFAULT 0"
|
||||
|
||||
# Contains dynamic configs
|
||||
chatconfig:
|
||||
|
@ -81,10 +81,10 @@ class HistoryController extends AbstractController
|
||||
}
|
||||
}
|
||||
if ($search_type == 'operator' || $search_type == 'all') {
|
||||
$search_conditions[] = "({chatthread}.agentName LIKE :query)";
|
||||
$search_conditions[] = "({chatthread}.agentname LIKE :query)";
|
||||
}
|
||||
if ($search_type == 'visitor' || $search_type == 'all') {
|
||||
$search_conditions[] = "({chatthread}.userName LIKE :query)";
|
||||
$search_conditions[] = "({chatthread}.username LIKE :query)";
|
||||
$search_conditions[] = "({chatthread}.remote LIKE :query)";
|
||||
}
|
||||
|
||||
|
@ -178,23 +178,23 @@ class Thread
|
||||
'nextAgent' => 'nextagent',
|
||||
'groupId' => 'groupid',
|
||||
'shownMessageId' => 'shownmessageid',
|
||||
'messageCount' => 'messageCount',
|
||||
'messageCount' => 'messagecount',
|
||||
'created' => 'dtmcreated',
|
||||
'modified' => 'dtmmodified',
|
||||
'chatStarted' => 'dtmchatstarted',
|
||||
'closed' => 'dtmclosed',
|
||||
'agentId' => 'agentId',
|
||||
'agentName' => 'agentName',
|
||||
'agentTyping' => 'agentTyping',
|
||||
'agentId' => 'agentid',
|
||||
'agentName' => 'agentname',
|
||||
'agentTyping' => 'agenttyping',
|
||||
'lastPingAgent' => 'lastpingagent',
|
||||
'locale' => 'locale',
|
||||
'userId' => 'userid',
|
||||
'userName' => 'userName',
|
||||
'userTyping' => 'userTyping',
|
||||
'userName' => 'username',
|
||||
'userTyping' => 'usertyping',
|
||||
'lastPingUser' => 'lastpinguser',
|
||||
'remote' => 'remote',
|
||||
'referer' => 'referer',
|
||||
'userAgent' => 'userAgent',
|
||||
'userAgent' => 'useragent',
|
||||
);
|
||||
|
||||
/**
|
||||
@ -1077,7 +1077,7 @@ class Thread
|
||||
|
||||
// Prepare query
|
||||
$query = "INSERT INTO {chatmessage} ("
|
||||
. "threadid, ikind, tmessage, tname, agentId, "
|
||||
. "threadid, ikind, tmessage, tname, agentid, "
|
||||
. "dtmcreated, plugin, data"
|
||||
. ") VALUES ("
|
||||
. ":threadid, :kind, :message, :name, :agentid, "
|
||||
|
@ -420,7 +420,7 @@ function calculate_operator_statistics()
|
||||
// Get base operator's info
|
||||
$db_results = $db->query(
|
||||
("SELECT (FLOOR(m.dtmcreated / :interval) * :interval) AS date, "
|
||||
. "m.agentId AS operator_id, "
|
||||
. "m.agentid AS operator_id, "
|
||||
. "COUNT(distinct m.threadid) AS threads, "
|
||||
. "COUNT(m.messageid) AS messages, "
|
||||
. "AVG(CHAR_LENGTH(m.tmessage)) AS avg_msg_length "
|
||||
@ -459,7 +459,7 @@ function calculate_operator_statistics()
|
||||
// Get info about invitations
|
||||
$db_results = $db->query(
|
||||
("SELECT (FLOOR(dtmcreated / :interval) * :interval) AS date, "
|
||||
. "agentId AS operator_id, "
|
||||
. "agentid AS operator_id, "
|
||||
. "COUNT(threadid) AS invitations_sent, "
|
||||
. "SUM(invitationstate = :invitation_accepted) AS invitations_accepted, "
|
||||
. "SUM(invitationstate = :invitation_rejected) AS invitations_rejected, "
|
||||
@ -470,7 +470,7 @@ function calculate_operator_statistics()
|
||||
// statistics_aggregation_interval
|
||||
. "AND (:today - dtmcreated) > :interval "
|
||||
// Check if thread has related operator
|
||||
. "AND agentId != 0 "
|
||||
. "AND agentid != 0 "
|
||||
// Ignore not accepted invitations
|
||||
. "AND (invitationstate = :invitation_accepted "
|
||||
. "OR invitationstate = :invitation_rejected "
|
||||
|
Loading…
Reference in New Issue
Block a user