From 11b08946194be1963d466e9cb215effd74793317 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 29 Jan 2019 15:27:53 +0800 Subject: [PATCH] rename accounts_kefu -> accounts --- sql/kefudb.sql | 6 +++--- webapp/controller/KefuController.class.php | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sql/kefudb.sql b/sql/kefudb.sql index 1cd2a20..00d7b02 100644 --- a/sql/kefudb.sql +++ b/sql/kefudb.sql @@ -16,13 +16,13 @@ /*!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 character_set_client = utf8 */; -CREATE TABLE `accounts_kefu` ( +CREATE TABLE `accounts` ( `idx` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id', `accountid` varchar(60) DEFAULT '' COMMENT '账号id(channel + "_" + gameid + "_" + openid)', `channel` int(11) NOT NULL COMMENT 'channel', diff --git a/webapp/controller/KefuController.class.php b/webapp/controller/KefuController.class.php index 465841f..0205825 100644 --- a/webapp/controller/KefuController.class.php +++ b/webapp/controller/KefuController.class.php @@ -232,7 +232,7 @@ class KefuController { $last_idx = 0; while (true) { $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( ':last_idx' => $last_idx, )); @@ -273,7 +273,7 @@ class KefuController { } $conn = $this->getMysql($accountid); $row = $conn->execQueryOne('SELECT awardtime ' . - "FROM accounts_kefu WHERE accountid = :accountid;", + "FROM accounts WHERE accountid = :accountid;", array( ':accountid' => $accountid, )); @@ -288,7 +288,7 @@ class KefuController { } if ($this->sendAwardMail($accountid, $awardConfig)) { - $ret = $conn->execScript("UPDATE accounts_kefu SET " . + $ret = $conn->execScript("UPDATE accounts SET " . ' awardtime=:awardtime ' . 'WHERE accountid=:accountid; ', array( @@ -309,10 +309,10 @@ class KefuController { { if ($msg['Event'] == 'user_enter_tempsession') { $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 ' . 'FROM DUAL ' . - 'WHERE NOT EXISTS(SELECT accountid FROM accounts_kefu WHERE accountid=:accountid);', + 'WHERE NOT EXISTS(SELECT accountid FROM accounts WHERE accountid=:accountid);', array( ':accountid' => $accountid, ':channel' => WEIXIN_CHANNEL,