累充礼包
This commit is contained in:
xcy 2023-12-22 14:33:43 +08:00
parent 372c84fd05
commit 76626120c4
4 changed files with 244 additions and 136 deletions

View File

@ -12,7 +12,7 @@ export default async function (call: ApiCall<ReqOpen, ResOpen>) {
// 每天open红点 // 每天open红点
G.mongodb.cEvent(`leichonglibao${call.req.hdid}`).updateOne( G.mongodb.cEvent(`leichonglibao${call.req.hdid}`).updateOne(
{type: `leichonglibao${call.req.hdid}`, uid: call.uid}, {$set: change} {type: `leichonglibao${call.req.hdid}`, uid: call.uid}, {$set: change}, {upsert: true}
) )
let temp = Object.assign((data || {}), change) as ResOpen & { opentime } let temp = Object.assign((data || {}), change) as ResOpen & { opentime }

View File

@ -42,6 +42,11 @@ export default async function (call: ApiCall<ReqReceive, ResReceive>) {
_prize.push(hddata.dlz[i][call.req.select[i] || "1"]) _prize.push(hddata.dlz[i][call.req.select[i] || "1"])
} }
// 修改领取标识
await G.mongodb.cEvent(`leichonglibao${call.req.hdid}`).updateOne(
{type: `leichonglibao${call.req.hdid}`, uid: call.uid}, {$set: {sc: true}}
)
PlayerFun.sendPrize(call, _prize) PlayerFun.sendPrize(call, _prize)
call.succ({prize: _prize}) call.succ({prize: _prize})
} }
@ -71,14 +76,21 @@ export async function LeiChongLiBaoBuyGift(call: ApiCall, payId: string) {
{type: `leichonglibao${hdid}`, uid: call.uid} {type: `leichonglibao${hdid}`, uid: call.uid}
) )
if (mydata.buy.includes(gift.payId)) { if (mydata && mydata.buy.includes(gift.payId)) {
console.log(call.uid, "购买累充礼包 重复购买", payId); console.log(call.uid, "购买累充礼包 重复购买", payId);
return return
} }
let update;
if (mydata) {
update = {$push: {buy: payId}}
} else {
update = {$set: {opentime: G.time, sc: false, buy: [payId]}}
}
PlayerFun.sendPrize(call, gift.prize) PlayerFun.sendPrize(call, gift.prize)
G.mongodb.cEvent(`leichonglibao${hdid}`).updateOne( G.mongodb.cEvent(`leichonglibao${hdid}`).updateOne(
{uid: call.uid, type: `leichonglibao${hdid}`}, {"$push": {buy: payId}} {uid: call.uid, type: `leichonglibao${hdid}`}, update
) )
} }

View File

@ -202,7 +202,6 @@ export function addListener() {
{ $inc: { payNum: conf.money } }, { $inc: { payNum: conf.money } },
{ upsert: true } { upsert: true }
); );
await PushGiftFun.buy(player.uid, payId) // 推送礼包 await PushGiftFun.buy(player.uid, payId) // 推送礼包
await LeiChongLiBaoBuyGift(call, payId) // 累充礼包 await LeiChongLiBaoBuyGift(call, payId) // 累充礼包
}); });

View File

@ -271,6 +271,7 @@ import { ReqBingo, ResBingo } from './PtlBingo';
import { ReqFightTest, ResFightTest } from './PtlFightTest'; import { ReqFightTest, ResFightTest } from './PtlFightTest';
import { ReqSyncBtn, ResSyncBtn } from './PtlSyncBtn'; import { ReqSyncBtn, ResSyncBtn } from './PtlSyncBtn';
import { ReqTest, ResTest } from './PtlTest'; import { ReqTest, ResTest } from './PtlTest';
import { ReqItemNoEnough, ResItemNoEnough } from './pushgift/PtlItemNoEnough';
import { ReqOpen as ReqOpen_51, ResOpen as ResOpen_51 } from './pushgift/PtlOpen'; import { ReqOpen as ReqOpen_51, ResOpen as ResOpen_51 } from './pushgift/PtlOpen';
import { ReqFight as ReqFight_9, ResFight as ResFight_9 } from './qjzzd/PtlFight'; import { ReqFight as ReqFight_9, ResFight as ResFight_9 } from './qjzzd/PtlFight';
import { ReqOpen as ReqOpen_52, ResOpen as ResOpen_52 } from './qjzzd/PtlOpen'; import { ReqOpen as ReqOpen_52, ResOpen as ResOpen_52 } from './qjzzd/PtlOpen';
@ -312,6 +313,7 @@ import { ReqOpen as ReqOpen_59, ResOpen as ResOpen_59 } from './task/PtlOpen';
import { ReqCDKEY, ResCDKEY } from './user/PtlCDKEY'; import { ReqCDKEY, ResCDKEY } from './user/PtlCDKEY';
import { ReqChangeInfo, ResChangeInfo } from './user/PtlChangeInfo'; import { ReqChangeInfo, ResChangeInfo } from './user/PtlChangeInfo';
import { ReqChangeName, ResChangeName } from './user/PtlChangeName'; import { ReqChangeName, ResChangeName } from './user/PtlChangeName';
import { ReqDot, ResDot } from './user/PtlDot';
import { ReqFight as ReqFight_12, ResFight as ResFight_12 } from './user/PtlFight'; import { ReqFight as ReqFight_12, ResFight as ResFight_12 } from './user/PtlFight';
import { ReqGetInfo, ResGetInfo } from './user/PtlGetInfo'; import { ReqGetInfo, ResGetInfo } from './user/PtlGetInfo';
import { ReqInfoOpen, ResInfoOpen } from './user/PtlInfoOpen'; import { ReqInfoOpen, ResInfoOpen } from './user/PtlInfoOpen';
@ -1325,6 +1327,10 @@ export interface ServiceType {
req: ReqTest, req: ReqTest,
res: ResTest res: ResTest
}, },
"pushgift/ItemNoEnough": {
req: ReqItemNoEnough,
res: ResItemNoEnough
},
"pushgift/Open": { "pushgift/Open": {
req: ReqOpen_51, req: ReqOpen_51,
res: ResOpen_51 res: ResOpen_51
@ -1489,6 +1495,10 @@ export interface ServiceType {
req: ReqChangeName, req: ReqChangeName,
res: ResChangeName res: ResChangeName
}, },
"user/Dot": {
req: ReqDot,
res: ResDot
},
"user/Fight": { "user/Fight": {
req: ReqFight_12, req: ReqFight_12,
res: ResFight_12 res: ResFight_12
@ -3145,126 +3155,131 @@ export const serviceProto: ServiceProto<ServiceType> = {
}, },
{ {
"id": 272, "id": 272,
"name": "pushgift/Open", "name": "pushgift/ItemNoEnough",
"type": "api" "type": "api"
}, },
{ {
"id": 273, "id": 273,
"name": "qjzzd/Fight", "name": "pushgift/Open",
"type": "api" "type": "api"
}, },
{ {
"id": 274, "id": 274,
"name": "qjzzd/Open", "name": "qjzzd/Fight",
"type": "api" "type": "api"
}, },
{ {
"id": 275, "id": 275,
"name": "rank/Open", "name": "qjzzd/Open",
"type": "api" "type": "api"
}, },
{ {
"id": 276, "id": 276,
"name": "shiwu/Concise", "name": "rank/Open",
"type": "api" "type": "api"
}, },
{ {
"id": 277, "id": 277,
"name": "shiwu/Extract", "name": "shiwu/Concise",
"type": "api" "type": "api"
}, },
{ {
"id": 278, "id": 278,
"name": "shiwu/GetList", "name": "shiwu/Extract",
"type": "api" "type": "api"
}, },
{ {
"id": 279, "id": 279,
"name": "shiwu/LvUp", "name": "shiwu/GetList",
"type": "api" "type": "api"
}, },
{ {
"id": 280, "id": 280,
"name": "shiwu/Recast", "name": "shiwu/LvUp",
"type": "api" "type": "api"
}, },
{ {
"id": 281, "id": 281,
"name": "shiwu/TakeOff", "name": "shiwu/Recast",
"type": "api" "type": "api"
}, },
{ {
"id": 282, "id": 282,
"name": "shiwu/Wear", "name": "shiwu/TakeOff",
"type": "api" "type": "api"
}, },
{ {
"id": 283, "id": 283,
"name": "shootGame/Open", "name": "shiwu/Wear",
"type": "api" "type": "api"
}, },
{ {
"id": 284, "id": 284,
"name": "shootGame/Rec", "name": "shootGame/Open",
"type": "api" "type": "api"
}, },
{ {
"id": 285, "id": 285,
"name": "shop/Buy", "name": "shootGame/Rec",
"type": "api" "type": "api"
}, },
{ {
"id": 286, "id": 286,
"name": "shop/Open", "name": "shop/Buy",
"type": "api" "type": "api"
}, },
{ {
"id": 287, "id": 287,
"name": "shop/Refresh", "name": "shop/Open",
"type": "api" "type": "api"
}, },
{ {
"id": 288, "id": 288,
"name": "sign/GetBoxPrize", "name": "shop/Refresh",
"type": "api" "type": "api"
}, },
{ {
"id": 289, "id": 289,
"name": "sign/GetPrize", "name": "sign/GetBoxPrize",
"type": "api" "type": "api"
}, },
{ {
"id": 290, "id": 290,
"name": "sign/Open", "name": "sign/GetPrize",
"type": "api" "type": "api"
}, },
{ {
"id": 291, "id": 291,
"name": "slzd/Aim", "name": "sign/Open",
"type": "api" "type": "api"
}, },
{ {
"id": 292, "id": 292,
"name": "slzd/BuyNum", "name": "slzd/Aim",
"type": "api" "type": "api"
}, },
{ {
"id": 293, "id": 293,
"name": "slzd/Fight", "name": "slzd/BuyNum",
"type": "api" "type": "api"
}, },
{ {
"id": 294, "id": 294,
"name": "slzd/FightLog", "name": "slzd/Fight",
"type": "api" "type": "api"
}, },
{ {
"id": 295, "id": 295,
"name": "slzd/MyRank", "name": "slzd/FightLog",
"type": "api" "type": "api"
}, },
{ {
"id": 296, "id": 296,
"name": "slzd/MyRank",
"type": "api"
},
{
"id": 297,
"name": "slzd/Open", "name": "slzd/Open",
"type": "api", "type": "api",
"conf": { "conf": {
@ -3274,77 +3289,77 @@ export const serviceProto: ServiceProto<ServiceType> = {
} }
}, },
{ {
"id": 297, "id": 298,
"name": "slzd/OpenFort", "name": "slzd/OpenFort",
"type": "api" "type": "api"
}, },
{ {
"id": 298, "id": 299,
"name": "slzd/Rec", "name": "slzd/Rec",
"type": "api" "type": "api"
}, },
{ {
"id": 299, "id": 300,
"name": "slzd/Refresh", "name": "slzd/Refresh",
"type": "api" "type": "api"
}, },
{ {
"id": 300, "id": 301,
"name": "slzd/Slot", "name": "slzd/Slot",
"type": "api" "type": "api"
}, },
{ {
"id": 301, "id": 302,
"name": "tanxian/Event", "name": "tanxian/Event",
"type": "api" "type": "api"
}, },
{ {
"id": 302, "id": 303,
"name": "tanxian/FastGuaJi", "name": "tanxian/FastGuaJi",
"type": "api" "type": "api"
}, },
{ {
"id": 303, "id": 304,
"name": "tanxian/Fight", "name": "tanxian/Fight",
"type": "api" "type": "api"
}, },
{ {
"id": 304, "id": 305,
"name": "tanxian/GuaJi", "name": "tanxian/GuaJi",
"type": "api" "type": "api"
}, },
{ {
"id": 305, "id": 306,
"name": "tanxian/Open", "name": "tanxian/Open",
"type": "api" "type": "api"
}, },
{ {
"id": 306, "id": 307,
"name": "tanxian/Receive", "name": "tanxian/Receive",
"type": "api" "type": "api"
}, },
{ {
"id": 307, "id": 308,
"name": "task/AllFinsh", "name": "task/AllFinsh",
"type": "api" "type": "api"
}, },
{ {
"id": 308, "id": 309,
"name": "task/Finsh", "name": "task/Finsh",
"type": "api" "type": "api"
}, },
{ {
"id": 309, "id": 310,
"name": "task/Open", "name": "task/Open",
"type": "api" "type": "api"
}, },
{ {
"id": 310, "id": 311,
"name": "user/CDKEY", "name": "user/CDKEY",
"type": "api" "type": "api"
}, },
{ {
"id": 311, "id": 312,
"name": "user/ChangeInfo", "name": "user/ChangeInfo",
"type": "api", "type": "api",
"conf": { "conf": {
@ -3352,197 +3367,202 @@ export const serviceProto: ServiceProto<ServiceType> = {
} }
}, },
{ {
"id": 312, "id": 313,
"name": "user/ChangeName", "name": "user/ChangeName",
"type": "api" "type": "api"
}, },
{
"id": 313,
"name": "user/Fight",
"type": "api"
},
{ {
"id": 314, "id": 314,
"name": "user/GetInfo", "name": "user/Dot",
"type": "api" "type": "api"
}, },
{ {
"id": 315, "id": 315,
"name": "user/InfoOpen", "name": "user/Fight",
"type": "api" "type": "api"
}, },
{ {
"id": 316, "id": 316,
"name": "user/Login", "name": "user/GetInfo",
"type": "api" "type": "api"
}, },
{ {
"id": 317, "id": 317,
"name": "user/Ping", "name": "user/InfoOpen",
"type": "api" "type": "api"
}, },
{ {
"id": 318, "id": 318,
"name": "user/Renown", "name": "user/Login",
"type": "api" "type": "api"
}, },
{ {
"id": 319, "id": 319,
"name": "user/RenownBuy", "name": "user/Ping",
"type": "api" "type": "api"
}, },
{ {
"id": 320, "id": 320,
"name": "user/RenownGetPrize", "name": "user/Renown",
"type": "api" "type": "api"
}, },
{ {
"id": 321, "id": 321,
"name": "user/RenownOpen", "name": "user/RenownBuy",
"type": "api" "type": "api"
}, },
{ {
"id": 322, "id": 322,
"name": "user/Tujian", "name": "user/RenownGetPrize",
"type": "api" "type": "api"
}, },
{ {
"id": 323, "id": 323,
"name": "weixiuchang/Decompose", "name": "user/RenownOpen",
"type": "api" "type": "api"
}, },
{ {
"id": 324, "id": 324,
"name": "weixiuchang/Exchange", "name": "user/Tujian",
"type": "api" "type": "api"
}, },
{ {
"id": 325, "id": 325,
"name": "weixiuchang/Open", "name": "weixiuchang/Decompose",
"type": "api" "type": "api"
}, },
{ {
"id": 326, "id": 326,
"name": "weixiuchang/UpLv", "name": "weixiuchang/Exchange",
"type": "api" "type": "api"
}, },
{ {
"id": 327, "id": 327,
"name": "weixiuchang/UpStar", "name": "weixiuchang/Open",
"type": "api" "type": "api"
}, },
{ {
"id": 328, "id": 328,
"name": "wzry/AutoBaoMing", "name": "weixiuchang/UpLv",
"type": "api" "type": "api"
}, },
{ {
"id": 329, "id": 329,
"name": "wzry/BaoMing", "name": "weixiuchang/UpStar",
"type": "api" "type": "api"
}, },
{ {
"id": 330, "id": 330,
"name": "wzry/catFightLog", "name": "wzry/AutoBaoMing",
"type": "api" "type": "api"
}, },
{ {
"id": 331, "id": 331,
"name": "wzry/CatGroup", "name": "wzry/BaoMing",
"type": "api" "type": "api"
}, },
{ {
"id": 332, "id": 332,
"name": "wzry/DldFight", "name": "wzry/catFightLog",
"type": "api" "type": "api"
}, },
{ {
"id": 333, "id": 333,
"name": "wzry/DldRefre", "name": "wzry/CatGroup",
"type": "api" "type": "api"
}, },
{ {
"id": 334, "id": 334,
"name": "wzry/JingCai", "name": "wzry/DldFight",
"type": "api" "type": "api"
}, },
{ {
"id": 335, "id": 335,
"name": "wzry/JingCaiOpen", "name": "wzry/DldRefre",
"type": "api" "type": "api"
}, },
{ {
"id": 336, "id": 336,
"name": "wzry/Open", "name": "wzry/JingCai",
"type": "api" "type": "api"
}, },
{ {
"id": 337, "id": 337,
"name": "wzry/UpdateFight", "name": "wzry/JingCaiOpen",
"type": "api" "type": "api"
}, },
{ {
"id": 338, "id": 338,
"name": "wzry/Wzzd", "name": "wzry/Open",
"type": "api" "type": "api"
}, },
{ {
"id": 339, "id": 339,
"name": "wzry/ZuanShiOpen", "name": "wzry/UpdateFight",
"type": "api" "type": "api"
}, },
{ {
"id": 340, "id": 340,
"name": "xstask/AllGet", "name": "wzry/Wzzd",
"type": "api" "type": "api"
}, },
{ {
"id": 341, "id": 341,
"name": "xstask/Get", "name": "wzry/ZuanShiOpen",
"type": "api" "type": "api"
}, },
{ {
"id": 342, "id": 342,
"name": "xstask/LvUp", "name": "xstask/AllGet",
"type": "api" "type": "api"
}, },
{ {
"id": 343, "id": 343,
"name": "xstask/OnekeyReceive", "name": "xstask/Get",
"type": "api" "type": "api"
}, },
{ {
"id": 344, "id": 344,
"name": "xstask/Open", "name": "xstask/LvUp",
"type": "api" "type": "api"
}, },
{ {
"id": 345, "id": 345,
"name": "xstask/Receive", "name": "xstask/OnekeyReceive",
"type": "api" "type": "api"
}, },
{ {
"id": 346, "id": 346,
"name": "xstask/Refresh", "name": "xstask/Open",
"type": "api" "type": "api"
}, },
{ {
"id": 347, "id": 347,
"name": "yongbingzhuzhan/Handle", "name": "xstask/Receive",
"type": "api" "type": "api"
}, },
{ {
"id": 348, "id": 348,
"name": "zhanqianbushu/ChangePos", "name": "xstask/Refresh",
"type": "api" "type": "api"
}, },
{ {
"id": 349, "id": 349,
"name": "zhanqianbushu/Select", "name": "yongbingzhuzhan/Handle",
"type": "api" "type": "api"
}, },
{ {
"id": 350, "id": 350,
"name": "zhanqianbushu/ChangePos",
"type": "api"
},
{
"id": 351,
"name": "zhanqianbushu/Select",
"type": "api"
},
{
"id": 352,
"name": "zhanqianbushu/Up", "name": "zhanqianbushu/Up",
"type": "api" "type": "api"
} }
@ -10298,7 +10318,8 @@ export const serviceProto: ServiceProto<ServiceType> = {
"name": "activityId", "name": "activityId",
"type": { "type": {
"type": "Number" "type": "Number"
} },
"optional": true
} }
] ]
}, },
@ -10326,6 +10347,23 @@ export const serviceProto: ServiceProto<ServiceType> = {
"type": { "type": {
"type": "Boolean" "type": "Boolean"
} }
},
{
"id": 3,
"name": "price",
"type": {
"type": "Number"
}
},
{
"id": 4,
"name": "showOffList",
"type": {
"type": "Array",
"elementType": {
"type": "Any"
}
}
} }
] ]
}, },
@ -10356,7 +10394,16 @@ export const serviceProto: ServiceProto<ServiceType> = {
"name": "timesRemaining", "name": "timesRemaining",
"type": { "type": {
"type": "Number" "type": "Number"
} },
"optional": true
},
{
"id": 2,
"name": "showOff",
"type": {
"type": "Boolean"
},
"optional": true
} }
] ]
}, },
@ -10876,30 +10923,8 @@ export const serviceProto: ServiceProto<ServiceType> = {
"type": { "type": {
"type": "Array", "type": "Array",
"elementType": { "elementType": {
"type": "Interface", "type": "Reference",
"properties": [ "target": "event/xiaofeijingsai/PtlOpen/data"
{
"id": 0,
"name": "_id",
"type": {
"type": "String"
}
},
{
"id": 1,
"name": "total",
"type": {
"type": "Number"
}
},
{
"id": 2,
"name": "player",
"type": {
"type": "Any"
}
}
]
} }
} }
}, },
@ -10907,6 +10932,13 @@ export const serviceProto: ServiceProto<ServiceType> = {
"id": 1, "id": 1,
"name": "myData", "name": "myData",
"type": { "type": {
"type": "Reference",
"target": "event/xiaofeijingsai/PtlOpen/data"
}
}
]
},
"event/xiaofeijingsai/PtlOpen/data": {
"type": "Interface", "type": "Interface",
"properties": [ "properties": [
{ {
@ -10925,15 +10957,19 @@ export const serviceProto: ServiceProto<ServiceType> = {
}, },
{ {
"id": 2, "id": 2,
"name": "rank",
"type": {
"type": "Number"
}
},
{
"id": 3,
"name": "player", "name": "player",
"type": { "type": {
"type": "Any" "type": "Any"
} }
} }
] ]
}
}
]
}, },
"event/xinshoulibao/PtlOpen/ReqOpen": { "event/xinshoulibao/PtlOpen/ReqOpen": {
"type": "Interface" "type": "Interface"
@ -15281,6 +15317,13 @@ export const serviceProto: ServiceProto<ServiceType> = {
"type": "Literal", "type": "Literal",
"literal": "leichonglibao" "literal": "leichonglibao"
} }
},
{
"id": 39,
"type": {
"type": "Literal",
"literal": "payForDiamond"
}
} }
] ]
}, },
@ -19399,6 +19442,37 @@ export const serviceProto: ServiceProto<ServiceType> = {
"PtlTest/ResTest": { "PtlTest/ResTest": {
"type": "Any" "type": "Any"
}, },
"pushgift/PtlItemNoEnough/ReqItemNoEnough": {
"type": "Interface",
"properties": [
{
"id": 0,
"name": "need",
"type": {
"type": "Interface",
"properties": [
{
"id": 0,
"name": "a",
"type": {
"type": "String"
}
},
{
"id": 1,
"name": "t",
"type": {
"type": "String"
}
}
]
}
}
]
},
"pushgift/PtlItemNoEnough/ResItemNoEnough": {
"type": "Interface"
},
"pushgift/PtlOpen/ReqOpen": { "pushgift/PtlOpen/ReqOpen": {
"type": "Interface" "type": "Interface"
}, },
@ -21363,6 +21437,29 @@ export const serviceProto: ServiceProto<ServiceType> = {
"user/PtlChangeName/ResChangeName": { "user/PtlChangeName/ResChangeName": {
"type": "Interface" "type": "Interface"
}, },
"user/PtlDot/ReqDot": {
"type": "Interface",
"properties": [
{
"id": 0,
"name": "type",
"type": {
"type": "String"
}
},
{
"id": 1,
"name": "data",
"type": {
"type": "Any"
},
"optional": true
}
]
},
"user/PtlDot/ResDot": {
"type": "Interface"
},
"user/PtlFight/ReqFight": { "user/PtlFight/ReqFight": {
"type": "Interface", "type": "Interface",
"properties": [ "properties": [