rename accounts_kefu -> accounts

This commit is contained in:
aozhiwei 2019-01-29 15:27:53 +08:00
parent 6f5d4c1e28
commit 11b0894619
2 changed files with 8 additions and 8 deletions

View File

@ -16,13 +16,13 @@
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
-- --
-- Table structure for table `accounts_kefu` -- Table structure for table `accounts`
-- --
DROP TABLE IF EXISTS `accounts_kefu`; DROP TABLE IF EXISTS `accounts`;
/*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `accounts_kefu` ( CREATE TABLE `accounts` (
`idx` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id', `idx` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
`accountid` varchar(60) DEFAULT '' COMMENT '账号id(channel + "_" + gameid + "_" + openid)', `accountid` varchar(60) DEFAULT '' COMMENT '账号id(channel + "_" + gameid + "_" + openid)',
`channel` int(11) NOT NULL COMMENT 'channel', `channel` int(11) NOT NULL COMMENT 'channel',

View File

@ -232,7 +232,7 @@ class KefuController {
$last_idx = 0; $last_idx = 0;
while (true) { while (true) {
$rows = $conn->execQuery('SELECT idx, accountid, openid, awardtime ' . $rows = $conn->execQuery('SELECT idx, accountid, openid, awardtime ' .
"FROM accounts_kefu WHERE idx > :last_idx LIMIT 0, 1000;", "FROM accounts WHERE idx > :last_idx LIMIT 0, 1000;",
array( array(
':last_idx' => $last_idx, ':last_idx' => $last_idx,
)); ));
@ -273,7 +273,7 @@ class KefuController {
} }
$conn = $this->getMysql($accountid); $conn = $this->getMysql($accountid);
$row = $conn->execQueryOne('SELECT awardtime ' . $row = $conn->execQueryOne('SELECT awardtime ' .
"FROM accounts_kefu WHERE accountid = :accountid;", "FROM accounts WHERE accountid = :accountid;",
array( array(
':accountid' => $accountid, ':accountid' => $accountid,
)); ));
@ -288,7 +288,7 @@ class KefuController {
} }
if ($this->sendAwardMail($accountid, $awardConfig)) { if ($this->sendAwardMail($accountid, $awardConfig)) {
$ret = $conn->execScript("UPDATE accounts_kefu SET " . $ret = $conn->execScript("UPDATE accounts SET " .
' awardtime=:awardtime ' . ' awardtime=:awardtime ' .
'WHERE accountid=:accountid; ', 'WHERE accountid=:accountid; ',
array( array(
@ -309,10 +309,10 @@ class KefuController {
{ {
if ($msg['Event'] == 'user_enter_tempsession') { if ($msg['Event'] == 'user_enter_tempsession') {
$conn = $this->getMysql($accountid); $conn = $this->getMysql($accountid);
$ret = $conn->execScript('INSERT INTO accounts_kefu(accountid, channel, gameid, openid, awardtime) ' . $ret = $conn->execScript('INSERT INTO accounts(accountid, channel, gameid, openid, awardtime) ' .
'SELECT :accountid, :channel, :gameid, :openid, :awardtime ' . 'SELECT :accountid, :channel, :gameid, :openid, :awardtime ' .
'FROM DUAL ' . 'FROM DUAL ' .
'WHERE NOT EXISTS(SELECT accountid FROM accounts_kefu WHERE accountid=:accountid);', 'WHERE NOT EXISTS(SELECT accountid FROM accounts WHERE accountid=:accountid);',
array( array(
':accountid' => $accountid, ':accountid' => $accountid,
':channel' => WEIXIN_CHANNEL, ':channel' => WEIXIN_CHANNEL,