5416 【工具】兑换码优化(兑换码邮件内容文件json支持不同的appID独立文件配置;)
1个文件已修改
1个文件已添加
45 ■■■■■ 已修改文件
Tool/WebCenter/Coupon/CodeMail_hyenglish.json 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Tool/WebCenter/CouponCode/webapp.py 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Tool/WebCenter/Coupon/CodeMail_hyenglish.json
New file
@@ -0,0 +1,26 @@
{
    "VIP666": {
        "MailSender": "Hệ thống thư",
        "MailTitle": "<gcode>VIP666 gói quà",
        "MailText": "Cảm ơn bạn đã hỗ trợ các trò chơi, xin vui lòng nhận được gói quà VIP666.",
        "Items": [[4680,1],[1128,1],[3801,1,1],[4501,2]],
        "LV":100,
        "VIPLV":5,
    },
    "g001": {
        "MailSender": "系统邮件",
        "MailTitle": "<gcode>历史累计返利活动",
        "MailText": "累积充值1000元返利,感谢您对游戏的支持,请及时领取礼包。",
        "Items": [[1015,1],[15177,2],[1128,2]],
        "Prefix":"CuuThien"
    },
    "h001": {
        "MailSender": "Hệ thống thư",
        "MailTitle": "<gcode>gói quà h001",
        "MailText": "Cảm ơn bạn đã hỗ trợ các trò chơi, xin vui lòng nhận được gói quà h001",
        "Items": [[1015,10],[15177,20],[1128,20]],
        "Prefix":"CuuThien"
    }
}
Tool/WebCenter/CouponCode/webapp.py
@@ -49,10 +49,20 @@
PushTimeout = ConfigIO.GetInt("Coupon", "PushTimeout", 5)
CommonCards = eval(ConfigIO.GetValue("Coupon", "CommonCards"))
g_mailJsonDict = {} # {channel:MailJson, ...}
# 发放奖励邮件内容json,utf8编码
f = open(os.getcwd() + "\\..\\Coupon\\CodeMail.json", "r")
MailJson = eval(f.read())
f.close()
def GetMailJson(channel):
    global g_mailJsonDict
    if channel in g_mailJsonDict:
        return g_mailJsonDict[channel]
    jsonPath = os.getcwd() + ("\\..\\Coupon\\CodeMail_%s.json" % channel)
    if not os.path.isfile(jsonPath):
        jsonPath = os.getcwd() + "\\..\\Coupon\\CodeMail.json"
    f = open(jsonPath, "r")
    MailJson = eval(f.read())
    f.close()
    g_mailJsonDict[channel] = MailJson
    return MailJson
# 礼包使用返回结果码定义
ErrCode_OK = 0 # 成功,非0的码均代表错误
@@ -305,6 +315,7 @@
        return SendGm(ErrCode_Invalid, gmresult, pushurl)[1]
    
    prefix = "" # 固定前缀
    MailJson = GetMailJson(agentName)
    if couponType in MailJson:
        mailInfo = MailJson[couponType]
        prefix = mailInfo.get("Prefix", "")
@@ -340,6 +351,7 @@
def CommCheck(dataDict, coupontype):
    ## 通用常规检查
    
    MailJson = GetMailJson(dataDict.get("channel", ""))
    if coupontype in MailJson:
        mailInfo = MailJson[coupontype]
        lvLimit = mailInfo.get("LV", 0)
@@ -390,6 +402,7 @@
            return errcode, CouponCodeResponse(errcode)
        
        coupontype = gmresult["coupontype"]
        MailJson = GetMailJson(gmresult["channel"])
        if coupontype in MailJson:
            mailInfo = MailJson[coupontype]
            mailTitle = mailInfo.get("MailTitle", "MailTitle")