Compare commits
2 Commits
9882a28090
...
540291696a
Author | SHA1 | Date | |
---|---|---|---|
![]() |
540291696a | ||
![]() |
d84173b67e |
@ -149,6 +149,12 @@ export class PayFun {
|
|||||||
needVip: 0,
|
needVip: 0,
|
||||||
front: {}
|
front: {}
|
||||||
}
|
}
|
||||||
|
} else if (payId == '136GiftAll') {
|
||||||
|
// 136礼包一键购买,加入所有礼包奖励
|
||||||
|
conf = {
|
||||||
|
...conf,
|
||||||
|
prize: R.compose(R.flatten(), R.map(i => i.prize), R.filter(i => i.id.indexOf('136Gift') != -1), R.values())(G.gc.pay)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return conf
|
return conf
|
||||||
}
|
}
|
||||||
@ -225,7 +231,7 @@ export class PayFun {
|
|||||||
prize.push(...conf.prize)
|
prize.push(...conf.prize)
|
||||||
}
|
}
|
||||||
|
|
||||||
let isReplaceConf = await this.checkBuysAfterPay(uid, payId, conf, payArgs)
|
let isReplaceConf = await this.checkBuysAfterPay(uid, payId, conf, payArgs, player)
|
||||||
if (isReplaceConf) {
|
if (isReplaceConf) {
|
||||||
let prizePayId = `zuanshi_${conf.money}`
|
let prizePayId = `zuanshi_${conf.money}`
|
||||||
payArgs.toPrizePayId = prizePayId
|
payArgs.toPrizePayId = prizePayId
|
||||||
@ -314,8 +320,9 @@ export class PayFun {
|
|||||||
* @param payId
|
* @param payId
|
||||||
* @param conf
|
* @param conf
|
||||||
* @param payArgs
|
* @param payArgs
|
||||||
|
* @param player
|
||||||
*/
|
*/
|
||||||
static async checkBuysAfterPay(uid, payId, conf, payArgs) {
|
static async checkBuysAfterPay(uid, payId, conf, payArgs, player) {
|
||||||
if (payId == 'G123SendGift') {
|
if (payId == 'G123SendGift') {
|
||||||
let giftInfo = await G.mongodb.collection('giftLog').findOne({popup_id: payArgs.popup_id});
|
let giftInfo = await G.mongodb.collection('giftLog').findOne({popup_id: payArgs.popup_id});
|
||||||
if (giftInfo.purchaseLimitAmount && giftInfo.buyNumber >= giftInfo.purchaseLimitAmount && number(giftInfo.price) > 0) {
|
if (giftInfo.purchaseLimitAmount && giftInfo.buyNumber >= giftInfo.purchaseLimitAmount && number(giftInfo.price) > 0) {
|
||||||
@ -327,6 +334,12 @@ export class PayFun {
|
|||||||
buyLog = buyLog.filter(v => v.time >= PublicShared.getToDayZeroTime(G.time));
|
buyLog = buyLog.filter(v => v.time >= PublicShared.getToDayZeroTime(G.time));
|
||||||
}
|
}
|
||||||
if (conf.buys > 0 && buyLog.length >= conf.buys) return true;
|
if (conf.buys > 0 && buyLog.length >= conf.buys) return true;
|
||||||
|
//针对周末礼包的单独处理
|
||||||
|
if (payId.indexOf('wkdlibao') != -1) {
|
||||||
|
let call = this.getCall(player)
|
||||||
|
let conf = await zmlbGetConf(call, {payId})
|
||||||
|
if (buyLog.length && buyLog.length >= conf.buyNum) return true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@ -376,10 +389,20 @@ export class PayFun {
|
|||||||
if (conf.time != -1 && buyLog.slice(-1)[0]?.eTime > G.time && conf.buys == 0 && payId.indexOf('wkdlibao') == -1) {
|
if (conf.time != -1 && buyLog.slice(-1)[0]?.eTime > G.time && conf.buys == 0 && payId.indexOf('wkdlibao') == -1) {
|
||||||
return G.server.sendMsgByUid(player.uid, 'msg_s2c/PayResult', {code: -2});
|
return G.server.sendMsgByUid(player.uid, 'msg_s2c/PayResult', {code: -2});
|
||||||
}
|
}
|
||||||
if (payId.indexOf('136Gift') != -1 && payId != '136Gift1') {
|
//针对每日礼包的单独处理
|
||||||
buyLog = await this.getPayLog(player.uid, '136Gift1');
|
let zeroTime = PublicShared.getToDayZeroTime(G.time)
|
||||||
if (buyLog.slice(-1)[0]?.eTime > G.time) return G.server.sendMsgByUid(player.uid, 'msg_s2c/PayResult', {code: -3});
|
if (payId.indexOf('136Gift') != -1 && payId != '136GiftAll') {
|
||||||
|
let buyLog136 = await this.getPayLog(player.uid, '136GiftAll');
|
||||||
|
buyLog136 = buyLog136.filter(v => v.time >= zeroTime);
|
||||||
|
if (buyLog136.length) return G.server.sendMsgByUid(player.uid, 'msg_s2c/PayResult', {code: -1});
|
||||||
}
|
}
|
||||||
|
if (payId.indexOf('136Gift') != -1 && payId == '136GiftAll') {
|
||||||
|
let ids = R.compose(R.map(i => i.id), R.filter(i => i.id.indexOf('136Gift') != -1 && i.id != '136GiftAll'), R.values())(G.gc.pay)
|
||||||
|
let buyLog136 = await this.getPayLogs(player.uid, ids);
|
||||||
|
let buyLog136list = R.compose(R.filter(v => v.time >= zeroTime), R.flatten(), R.values())(buyLog136)
|
||||||
|
if (buyLog136list.length) return G.server.sendMsgByUid(player.uid, 'msg_s2c/PayResult', {code: -1});
|
||||||
|
}
|
||||||
|
//针对周末礼包的单独处理
|
||||||
if (payId.indexOf('wkdlibao') != -1) {
|
if (payId.indexOf('wkdlibao') != -1) {
|
||||||
let call = this.getCall(player)
|
let call = this.getCall(player)
|
||||||
let conf = await zmlbGetConf(call, {payId})
|
let conf = await zmlbGetConf(call, {payId})
|
||||||
|
Loading…
Reference in New Issue
Block a user