Commit eb4b015247152707d97420abbc2973538e4948ea
1 parent
94edf97b
邮件增加 stitle
Showing
5 changed files
with
17 additions
and
5 deletions
Show diff stats
src/actions/EmailAction.lua
src/models/Email.lua
... | ... | @@ -9,6 +9,7 @@ Email.schema = { |
9 | 9 | id = {"number", 0}, -- 数据库ID |
10 | 10 | emailId = {"number", 0}, -- 邮件csv ID |
11 | 11 | title = {"string", ""}, -- 邮件标题 |
12 | + stitle = {"string", ""}, -- 小标题 | |
12 | 13 | content = {"string", ""}, -- 邮件正文 |
13 | 14 | attachments = {"string", ""}, |
14 | 15 | status = {"number", 0}, -- 邮件状态: 未读, 已读, 已领取 |
... | ... | @@ -20,6 +21,7 @@ Email.schema = { |
20 | 21 | function Email:data() |
21 | 22 | local emailId = self:getProperty("emailId") |
22 | 23 | local title = self:getProperty("title") |
24 | + local stitle = self:getProperty("stitle") | |
23 | 25 | local content = self:getProperty("content") |
24 | 26 | local attachments = self:getProperty("attachments") |
25 | 27 | local contentPms = self:getProperty("contentPms") |
... | ... | @@ -37,6 +39,10 @@ function Email:data() |
37 | 39 | if title == "" and emailData.title ~= "" then |
38 | 40 | title = emailData.title |
39 | 41 | end |
42 | + | |
43 | + if stitle == "" and emailData.subtitle ~= "" then | |
44 | + stitle = emailData.subtitle | |
45 | + end | |
40 | 46 | |
41 | 47 | if attachments == "" and emailData.attachment ~= "" then |
42 | 48 | attachments = emailData.attachment:format(table.unpack(rewardPms)) |
... | ... | @@ -48,6 +54,7 @@ function Email:data() |
48 | 54 | status = self:getProperty("status"), |
49 | 55 | createtime = self:getProperty("createtime"), |
50 | 56 | title = title, |
57 | + stitle = stitle, | |
51 | 58 | content = content, |
52 | 59 | attachments = attachments, |
53 | 60 | } | ... | ... |
src/rdsscripts/insertEmail.lua
... | ... | @@ -5,8 +5,9 @@ local createTime = KEYS[4] |
5 | 5 | local con = KEYS[5] or cmsgpack.pack({}) |
6 | 6 | local att = KEYS[6] or cmsgpack.pack({}) |
7 | 7 | local title = KEYS[7] or "" |
8 | -local content = KEYS[8] or "" | |
9 | -local attachments = KEYS[9] or "" | |
8 | +local stitle = KEYS[8] or "" | |
9 | +local content = KEYS[9] or "" | |
10 | +local attachments = KEYS[10] or "" | |
10 | 11 | |
11 | 12 | |
12 | 13 | -- local roleInfo = redis.call("HGET", string.format("role:%d", roleId), "delete") |
... | ... | @@ -29,6 +30,7 @@ redis.call("HMSET", string.format("email:%d:%d", roleId, id), |
29 | 30 | "contentPms", con, |
30 | 31 | "rewardPms", att, |
31 | 32 | "title", title, |
33 | + "stitle", stitle, | |
32 | 34 | "content", content, |
33 | 35 | "attachments", attachments |
34 | 36 | ) | ... | ... |
src/services/globald.lua
... | ... | @@ -63,6 +63,7 @@ local function mailQuene() |
63 | 63 | "id", gid, |
64 | 64 | "createtime", email.endTime, |
65 | 65 | "title", email.title, |
66 | + "stitle", email.stitle, | |
66 | 67 | "content", email.content, |
67 | 68 | "attachments", email.attachments, |
68 | 69 | "endtime", email.endTime, |
... | ... | @@ -73,7 +74,7 @@ local function mailQuene() |
73 | 74 | redisproxy:hmset(string_format("globalEmail:%s", gid), |
74 | 75 | "id", gid, |
75 | 76 | "createtime", email.endTime, |
76 | - "title", email.title, | |
77 | + "stitle", email.stitle, | |
77 | 78 | "content", email.content, |
78 | 79 | "attachments", email.attachments, |
79 | 80 | "endtime", email.endTime, | ... | ... |
src/shared/redisproxy.lua
... | ... | @@ -54,12 +54,13 @@ function redisproxy:insertEmail(params) |
54 | 54 | con = params.con or {}, |
55 | 55 | att = params.att or {}, |
56 | 56 | title = params.title or "", |
57 | + stitle = params.stitle or "", | |
57 | 58 | content = params.content or "", |
58 | 59 | attachments = params.attachments or "", |
59 | 60 | } |
60 | - self:runScripts("insertEmail", 9, EMAIL_LIMIT, | |
61 | + self:runScripts("insertEmail", 10, EMAIL_LIMIT, | |
61 | 62 | pms.roleId, pms.emailId, pms.createtime, |
62 | - MsgPack.pack(pms.con), MsgPack.pack(pms.att), pms.title, pms.content, pms.attachments) | |
63 | + MsgPack.pack(pms.con), MsgPack.pack(pms.att), pms.title, pms.stitle, pms.content, pms.attachments) | |
63 | 64 | return true |
64 | 65 | end |
65 | 66 | ... | ... |