Commit 54f63c13ab6a8f0226523a6653005260615f90ad
1 parent
2ffd37cc
修复老月卡用户的月卡id字段
Showing
2 changed files
with
24 additions
and
2 deletions
Show diff stats
src/models/Store.lua
| @@ -3,7 +3,29 @@ | @@ -3,7 +3,29 @@ | ||
| 3 | local Store = class("Store", require("shared.ModelBase")) | 3 | local Store = class("Store", require("shared.ModelBase")) |
| 4 | 4 | ||
| 5 | function Store:ctor(properties) | 5 | function Store:ctor(properties) |
| 6 | - Store.super.ctor(self, properties) | 6 | + Store.super.ctor(self, properties) |
| 7 | +end | ||
| 8 | + | ||
| 9 | +function Store:onLoad() | ||
| 10 | + local monEx = self:getProperty("monthCardEx") | ||
| 11 | + local smonEx = self:getProperty("smonthCardEx") | ||
| 12 | + local monId = self:getProperty("monthCardId") | ||
| 13 | + local smonId = self:getProperty("smonthCardId") | ||
| 14 | + local timeNow = skynet.timex() | ||
| 15 | + local flag = false | ||
| 16 | + if monEx > timeNow and monId == 0 then | ||
| 17 | + self:updateProperty({field = "monthCardId", value = 101}) | ||
| 18 | + self:updateProperty({field = "getMailT1", value = 0}) | ||
| 19 | + flag = true | ||
| 20 | + end | ||
| 21 | + if smonEx > timeNow and smonId == 0 then | ||
| 22 | + self:updateProperty({field = "smonthCardId", value = 102}) | ||
| 23 | + self:updateProperty({field = "getMailT2", value = 0}) | ||
| 24 | + flag = true | ||
| 25 | + end | ||
| 26 | + if flag then | ||
| 27 | + self:sendMonthCardEmail() | ||
| 28 | + end | ||
| 7 | end | 29 | end |
| 8 | 30 | ||
| 9 | ActGoodsType = { | 31 | ActGoodsType = { |