Commit 763ecaffef41132cb7efea6a91afc24d6b8b8d6a
Merge branch 'tr/bugfix' into tr/publish/release
* tr/bugfix: 修复老月卡用户的月卡id字段 # Conflicts: # src/csvdata
Showing
1 changed file
with
23 additions
and
1 deletions
Show diff stats
src/models/Store.lua
| ... | ... | @@ -3,7 +3,29 @@ |
| 3 | 3 | local Store = class("Store", require("shared.ModelBase")) |
| 4 | 4 | |
| 5 | 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 | 29 | end |
| 8 | 30 | |
| 9 | 31 | ActGoodsType = { | ... | ... |