From ef699fe8cd45bccc3786d0bf068810df4f02afd7 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 14 Sep 2023 13:20:36 +0800 Subject: [PATCH] 1 --- sql/gamedb.sql | 2 ++ sql/gamedb2006_migrate_230913_01.sql | 2 ++ webapp/controller/MailController.class.php | 40 ++++++++++++++++++++++ 3 files changed, 44 insertions(+) diff --git a/sql/gamedb.sql b/sql/gamedb.sql index 16cde481..a8fa2add 100644 --- a/sql/gamedb.sql +++ b/sql/gamedb.sql @@ -1663,6 +1663,8 @@ CREATE TABLE `t_mail` ( `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id', `account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id(channel + "_" + gameid + "_" + openid)', `mailid` bigint NOT NULL DEFAULT '0' COMMENT '邮件id', + `confirmed` int(11) NOT NULL DEFAULT '0' COMMENT 'confirmed', + `attachments` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '附件', `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', PRIMARY KEY (`idx`), diff --git a/sql/gamedb2006_migrate_230913_01.sql b/sql/gamedb2006_migrate_230913_01.sql index 171e3b2d..aeeecb19 100644 --- a/sql/gamedb2006_migrate_230913_01.sql +++ b/sql/gamedb2006_migrate_230913_01.sql @@ -4,6 +4,8 @@ CREATE TABLE `t_mail` ( `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id', `account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id(channel + "_" + gameid + "_" + openid)', `mailid` bigint NOT NULL DEFAULT '0' COMMENT '邮件id', + `confirmed` int(11) NOT NULL DEFAULT '0' COMMENT 'confirmed', + `attachments` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '附件', `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', PRIMARY KEY (`idx`), diff --git a/webapp/controller/MailController.class.php b/webapp/controller/MailController.class.php index 6a3af676..a8e1e01d 100644 --- a/webapp/controller/MailController.class.php +++ b/webapp/controller/MailController.class.php @@ -3,8 +3,48 @@ class MailController extends BaseAuthedController { public function getAttachment() + { + $mailIds = getReqVal('mail_ids', ''); + + $response = ''; + { + $params = array( + 'c' => 'Mail', + 'a' => 'getAttachment', + 'account_id' => myself()->_getAccountId(), + 'session_id' => myself()->_getSessionId(), + 'mail_ids' => $mailIds + ); + + $url = self::getMailServerUrl(); + if (!phpcommon\HttpClient::get + ($url, + $params, + $response)) { + myself()->_rspErr(500, 'server internal error 3, url:' . $url); + die(); + return; + } + } + $rspObj = json_decode($response, true); + if ($rspObj && $rspObj['errcode'] == 0) { + $this->procAttachments($rspObj['attachments']); + } + echo $response; + } + + private function procAttachments($attachments) { } + private static function getMailServerUrl() + { + if (SERVER_ENV != _ONLINE) { + return "https://gamemail-test.kingsome.cn/webapp/index.php"; + } else { + return "https://gamemail-test.cebggame.com/webapp/index.php"; + } + } + }