From 8d2f402570285e5fa1a710f6b08a409bf3e21738 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 9 May 2024 17:37:46 +0800 Subject: [PATCH] 1 --- database/maildb.sql | 16 ++++++++++++++++ server/mailserver/mail/mail.go | 6 +++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/database/maildb.sql b/database/maildb.sql index e2de21a9..d06e5e77 100644 --- a/database/maildb.sql +++ b/database/maildb.sql @@ -123,6 +123,22 @@ CREATE TABLE `t_inbox` ( /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; +-- +-- Table structure for table `t_event` +-- + +DROP TABLE IF EXISTS `t_event`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_event` ( + `idx` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id', + `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', + `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', + PRIMARY KEY (`idx`) +) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; diff --git a/server/mailserver/mail/mail.go b/server/mailserver/mail/mail.go index e3464a40..a377ce19 100644 --- a/server/mailserver/mail/mail.go +++ b/server/mailserver/mail/mail.go @@ -36,8 +36,8 @@ func (this *mail) loadFromDb(ds *f5.DataSet) { this.mailType = q5.ToInt32(ds.GetByName("mail_type")) this.subject = ds.GetByName("subject") this.content = ds.GetByName("content") - this.sendTime = q5.ToInt32(ds.GetByName("sendTime")) - this.expireTime = q5.ToInt32(ds.GetByName("expireTime")) + this.sendTime = q5.ToInt32(ds.GetByName("sendtime")) + this.expireTime = q5.ToInt32(ds.GetByName("expiretime")) this.userRegStartTime = q5.ToInt32(ds.GetByName("user_reg_start_time")) this.userRegEndTime = q5.ToInt32(ds.GetByName("user_reg_end_time")) { @@ -68,7 +68,7 @@ func (this *mail) isType(mailType int32) bool { } func (this *mail) IsValid(hum common.Player) bool { - if f5.GetApp().GetRealSeconds() > int64(this.expireTime) && + if f5.GetApp().GetRealSeconds() < int64(this.expireTime) && hum.GetRegisterTime() >= this.userRegStartTime && hum.GetRegisterTime() <= this.userRegEndTime { if this.mailType == constant.MAIL_TYPE_GROUP {