Commit b6a84789e114f0852ba603db52f6d853f7cf068d

Authored by jiyue
2 parents 95d3923e 99f84aa1

Merge branch 'cn/develop' into cn/publish/preview

Showing 1 changed file with 7 additions and 15 deletions   Show diff stats
src/models/Store.lua
... ... @@ -33,7 +33,7 @@ Store.schema = {
33 33 firstMonthCard = {"number", 1}, -- 首次订阅月卡
34 34 monthCardReceive = {"number", 0}, -- 月卡奖励领取记录 当天 0-未领取, 1-已经领取
35 35  
36   - smonthCards = {"table", {}}, --特刊信息 {[id]={["buyCount"]=0, ["periods"]=0, ["openFlag"]= 1}} buyCount: 购买次数,periods: 剩余期数,openFlag: 是否开放标识
  36 + smonthCards = {"table", {}}, --特刊信息 {[id]={["buyCount"]=0, ["periods"]=0}} buyCount: 购买次数,periods: 剩余期数,
37 37 smonthCardReceive = {"number", 0}, -- 特刊奖励领取记录 当天 0-未领取, 1-已经领取
38 38  
39 39 battleCard = {"number", 0}, -- 赛季卡
... ... @@ -105,9 +105,6 @@ SuperMonthCard["buy"] = function(self, id)
105 105  
106 106 local smonthCard = smonthCards[id] or {}
107 107 if next(smonthCard) then
108   - local rechargeData = csvdb["shop_rechargeCsv"][id] or {}
109   - local buyCount = smonthCard["buyCount"] or 0
110   - if buyCount >= (rechargeData["limit"] or 3) then return false end
111 108  
112 109 smonthCard["buyCount"] = (smonthCard["buyCount"] or 0) + 1
113 110  
... ... @@ -120,21 +117,16 @@ SuperMonthCard["buy"] = function(self, id)
120 117 end
121 118 end
122 119 BuyMonthCard["order"] = function()
123   - --增刊条件 + 标识
124   - for _, val in pairs(smonthCards) do
125   - val["openFlag"] = 0
126   - end
127   -
  120 + --增刊条件
128 121 local card = csvdb["shop_cardCsv"][id] or {}
129   - if (card["cardPlusFlag"] or 0) ~= 1 then return false end
130   -
131 122 --判断是否购买过增刊条件里的特刊
  123 + local cardId = card["cardPlusCondition"] or 0
  124 + if self:isMonthCardExpire() or smonthCards[cardId] == nil then return false end
132 125  
133   - local cardPlusCondition = card["cardPlusCondition"] or 0
134   - if self:isMonthCardExpire() or smonthCards[cardPlusCondition] == nil then return false end
  126 + --如果上期特刊奖励没有领取玩,则不能购买这期特刊。
  127 + if SuperMonthCard["isExpired"](self, cardId) == false and cardId ~= 101 then return false end
135 128  
136   - local smonthCard = {["periods"] = (card["cardPlusPeriods"] or 30), ["buyCount"] = 1, ["openFlag"] = 1 }
137   - smonthCards[id] = smonthCard
  129 + smonthCards[id] = {["periods"] = (card["cardPlusPeriods"] or 30), ["buyCount"] = 1}
138 130  
139 131 self:updateProperty({filed = "smonthCards", value = smonthCards})
140 132 return true
... ...