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 348 ["check"] = function(self, actType, notify, twd) -- 检查
349 349 local oldVal = self:getActData(actType) or 0
350 350 local newVal = oldVal + twd
351   - local gift = self.owner:getPaybackReward(oldVal, newVal)
  351 + local gift, checkPoint = self.owner:getPaybackReward(oldVal, newVal)
352 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 355 end
355 356 self:updateActData(actType, newVal, not notify)
356 357 end,
... ...
src/models/RolePlugin.lua
... ... @@ -1704,6 +1704,7 @@ function RolePlugin.bind(Role)
1704 1704 function Role:getPaybackReward(oldVal, newVal)
1705 1705 local maxVal, diff, extraReward = 0, 0, ""
1706 1706 local gift = ""
  1707 + local checkPoint = {}
1707 1708 for k, v in pairs(csvdb["rebateCsv"]) do
1708 1709 if k > maxVal then
1709 1710 maxVal = k
... ... @@ -1714,21 +1715,27 @@ function RolePlugin.bind(Role)
1714 1715 end
1715 1716 if oldVal < k and newVal > k then
1716 1717 gift = gift .. v.reward .. " "
  1718 +
  1719 + table.insert(checkPoint, k)
1717 1720 end
1718 1721 end
1719 1722 if newVal > maxVal then
1720 1723 local cnt = 0
  1724 + local oldCheckPoint = 0
1721 1725 if oldVal < maxVal then
1722 1726 cnt = math.floor((newVal - maxVal) / diff)
  1727 + oldCheckPoint = maxVal
1723 1728 else
1724 1729 cnt = math.floor((newVal - maxVal) / diff) - math.floor((oldVal - maxVal) / diff)
  1730 + oldCheckPoint = maxVal + math.floor((oldVal - maxVal) / diff) * diff
1725 1731 end
1726 1732 for i = 1, cnt do
1727 1733 gift = gift .. extraReward .. " "
  1734 +
  1735 + table.insert(checkPoint, oldCheckPoint + i * diff)
1728 1736 end
1729 1737 end
1730   -
1731   - return gift
  1738 + return gift, checkPoint
1732 1739 end
1733 1740  
1734 1741 end
... ...