Commit 4709685d007e204489faeb753ff334de91744a82

Authored by liuzujun
1 parent 9c8e9482

返利邮件拼接充值档位

Showing 2 changed files with 12 additions and 4 deletions   Show diff stats
src/models/Activity.lua
@@ -348,9 +348,10 @@ activityFunc[Activity.ActivityType.PayBack] = { @@ -348,9 +348,10 @@ activityFunc[Activity.ActivityType.PayBack] = {
348 ["check"] = function(self, actType, notify, twd) -- 检查 348 ["check"] = function(self, actType, notify, twd) -- 检查
349 local oldVal = self:getActData(actType) or 0 349 local oldVal = self:getActData(actType) or 0
350 local newVal = oldVal + twd 350 local newVal = oldVal + twd
351 - local gift = self.owner:getPaybackReward(oldVal, newVal) 351 + local gift, checkPoint = self.owner:getPaybackReward(oldVal, newVal)
352 if gift ~= "" then 352 if gift ~= "" then
353 - self.owner:sendMail(MailId.PayBackAward, nil, gift, {newVal}) 353 + local strCp = table.concat(checkPoint ,"/")
  354 + self.owner:sendMail(MailId.PayBackAward, nil, gift, {newVal, strCp})
354 end 355 end
355 self:updateActData(actType, newVal, not notify) 356 self:updateActData(actType, newVal, not notify)
356 end, 357 end,
src/models/RolePlugin.lua
@@ -1704,6 +1704,7 @@ function RolePlugin.bind(Role) @@ -1704,6 +1704,7 @@ function RolePlugin.bind(Role)
1704 function Role:getPaybackReward(oldVal, newVal) 1704 function Role:getPaybackReward(oldVal, newVal)
1705 local maxVal, diff, extraReward = 0, 0, "" 1705 local maxVal, diff, extraReward = 0, 0, ""
1706 local gift = "" 1706 local gift = ""
  1707 + local checkPoint = {}
1707 for k, v in pairs(csvdb["rebateCsv"]) do 1708 for k, v in pairs(csvdb["rebateCsv"]) do
1708 if k > maxVal then 1709 if k > maxVal then
1709 maxVal = k 1710 maxVal = k
@@ -1714,21 +1715,27 @@ function RolePlugin.bind(Role) @@ -1714,21 +1715,27 @@ function RolePlugin.bind(Role)
1714 end 1715 end
1715 if oldVal < k and newVal > k then 1716 if oldVal < k and newVal > k then
1716 gift = gift .. v.reward .. " " 1717 gift = gift .. v.reward .. " "
  1718 +
  1719 + table.insert(checkPoint, k)
1717 end 1720 end
1718 end 1721 end
1719 if newVal > maxVal then 1722 if newVal > maxVal then
1720 local cnt = 0 1723 local cnt = 0
  1724 + local oldCheckPoint = 0
1721 if oldVal < maxVal then 1725 if oldVal < maxVal then
1722 cnt = math.floor((newVal - maxVal) / diff) 1726 cnt = math.floor((newVal - maxVal) / diff)
  1727 + oldCheckPoint = maxVal
1723 else 1728 else
1724 cnt = math.floor((newVal - maxVal) / diff) - math.floor((oldVal - maxVal) / diff) 1729 cnt = math.floor((newVal - maxVal) / diff) - math.floor((oldVal - maxVal) / diff)
  1730 + oldCheckPoint = maxVal + math.floor((oldVal - maxVal) / diff) * diff
1725 end 1731 end
1726 for i = 1, cnt do 1732 for i = 1, cnt do
1727 gift = gift .. extraReward .. " " 1733 gift = gift .. extraReward .. " "
  1734 +
  1735 + table.insert(checkPoint, oldCheckPoint + i * diff)
1728 end 1736 end
1729 end 1737 end
1730 -  
1731 - return gift 1738 + return gift, checkPoint
1732 end 1739 end
1733 1740
1734 end 1741 end