Compare commits

..

8 Commits

Author SHA1 Message Date
dy
428033b26f Merge branch 'bugfix' into release 2023-12-31 17:43:30 +08:00
dy
4448b2dfa8 Merge branch 'bugfix' into release 2023-12-31 16:30:16 +08:00
dy
087b8ff146 Merge branch 'feature/json' into release 2023-12-31 16:01:52 +08:00
dy
3ba27f5180 cehua public json 2023-12-31 16:01:41 +08:00
dy
d8a7fa14d0 Merge remote-tracking branch 'origin/bugfix' into release 2023-12-31 15:59:30 +08:00
dy
a84f20361f 累充 2023-12-31 11:45:44 +08:00
dy
96675a9ff1 累计充值 2023-12-31 09:48:26 +08:00
dy
6fd4e79fbe 累计充值 2023-12-30 16:32:26 +08:00
9 changed files with 23906 additions and 14671 deletions

View File

@ -3,6 +3,7 @@ import { HuoDongFun } from "../../../public/huodongfun";
import {PayFun} from '../../../public/pay';
import {ReqOpen, ResOpen} from "../../../shared/protocols/event/leijichongzhi/PtlOpen";
import {PublicShared} from '../../../shared/public/public';
import {checkNextRound} from "./ApiRec";
export default async function (call: ApiCall<ReqOpen, ResOpen>) {
let _hdinfo = await HuoDongFun.getHdidInfo(call, call.req.hdid)
@ -16,17 +17,22 @@ export default async function (call: ApiCall<ReqOpen, ResOpen>) {
let sTime = db?.sTime || PublicShared.getToDayZeroTime(G.time);
if (!db) {
G.mongodb.cEvent(_dbType).updateOne(
await G.mongodb.cEvent(_dbType).updateOne(
{uid: call.uid, type: _dbType},
{$set: {sTime: sTime, recIndex: []}},
{upsert: true}
);
}
db = await checkNextRound(call, db, _hdinfo.data.tasks)
let payNum = (await PayFun.getPayDaysAllPayNum(call.uid, _hdinfo.stime, _hdinfo.rtime)) * 10
payNum = payNum - (db.round || 0) * R.sort((a, b) => b.total - a.total)(_hdinfo.data.tasks)[0].total
call.succ({
sTime: sTime,
recIndex: db?.recIndex || [],
payNum: (await PayFun.getPayDaysAllPayNum(call.uid, _hdinfo.stime, _hdinfo.rtime)) * 10,
hdinfo: _hdinfo
payNum: payNum,
hdinfo: _hdinfo,
round: db.round || 0
});
}

View File

@ -21,17 +21,29 @@ export default async function (call: ApiCall<ReqRec, ResRec>) {
if (db.recIndex.includes(call.req.index)) return call.error('', {code: -2});
let payNum = (await PayFun.getPayDaysAllPayNum(call.uid, _hdinfo.stime, _hdinfo.rtime)) * 10;
payNum = payNum - (db.round || 0) * R.sort((a, b) => b.total - a.total)(_hdinfo.data.tasks)[0].total
if (payNum < conf.total) return call.error('', {code: -3});
await PlayerFun.sendPrize(call, conf.prize);
G.mongodb.cEvent(_dbType).updateOne(
await G.mongodb.cEvent(_dbType).updateOne(
{uid: call.uid, type: _dbType},
{$push: {recIndex: call.req.index}}
);
await checkNextRound(call, db, _hdinfo.data.tasks)
HongDianChange.sendChangeKey(call.uid, ['huodonghd'])
call.succ({
prize: conf.prize
});
}
export async function checkNextRound(call: ApiCall, event, tasks) {
let _dbType: `leijichongzhi${number}` = `leijichongzhi${call.req.hdid}`
if ((event?.recIndex?.length || 0) < tasks.length) return event
return (await G.mongodb.cEvent(_dbType).findOneAndUpdate(
{uid: call.uid, type: _dbType},
{$set: {recIndex: []}, $inc: {round: 1}}, {returnDocument: 'after'}
)).value;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -537,8 +537,8 @@
"mapId": 420,
"prize": [
{
"a": "item",
"t": "4",
"a": "attr",
"t": "rmbmoney",
"n": 100
}
],
@ -550,8 +550,8 @@
"mapId": 430,
"prize": [
{
"a": "attr",
"t": "rmbmoney",
"a": "item",
"t": "4",
"n": 5
}
],
@ -589,8 +589,8 @@
"mapId": 460,
"prize": [
{
"a": "item",
"t": "4",
"a": "attr",
"t": "rmbmoney",
"n": 100
}
],
@ -615,8 +615,8 @@
"mapId": 480,
"prize": [
{
"a": "attr",
"t": "rmbmoney",
"a": "item",
"t": "4",
"n": 5
}
],
@ -641,8 +641,8 @@
"mapId": 500,
"prize": [
{
"a": "item",
"t": "4",
"a": "attr",
"t": "rmbmoney",
"n": 100
}
],
@ -680,8 +680,8 @@
"mapId": 530,
"prize": [
{
"a": "attr",
"t": "rmbmoney",
"a": "item",
"t": "4",
"n": 5
}
],
@ -693,8 +693,8 @@
"mapId": 540,
"prize": [
{
"a": "item",
"t": "4",
"a": "attr",
"t": "rmbmoney",
"n": 100
}
],
@ -797,8 +797,8 @@
"mapId": 620,
"prize": [
{
"a": "item",
"t": "4",
"a": "attr",
"t": "rmbmoney",
"n": 100
}
],
@ -810,8 +810,8 @@
"mapId": 630,
"prize": [
{
"a": "attr",
"t": "rmbmoney",
"a": "item",
"t": "4",
"n": 5
}
],
@ -849,8 +849,8 @@
"mapId": 660,
"prize": [
{
"a": "item",
"t": "4",
"a": "attr",
"t": "rmbmoney",
"n": 100
}
],
@ -875,8 +875,8 @@
"mapId": 680,
"prize": [
{
"a": "attr",
"t": "rmbmoney",
"a": "item",
"t": "4",
"n": 5
}
],
@ -901,8 +901,8 @@
"mapId": 700,
"prize": [
{
"a": "item",
"t": "4",
"a": "attr",
"t": "rmbmoney",
"n": 100
}
],
@ -940,8 +940,8 @@
"mapId": 730,
"prize": [
{
"a": "attr",
"t": "rmbmoney",
"a": "item",
"t": "4",
"n": 5
}
],
@ -953,8 +953,8 @@
"mapId": 740,
"prize": [
{
"a": "item",
"t": "4",
"a": "attr",
"t": "rmbmoney",
"n": 100
}
],
@ -1057,8 +1057,8 @@
"mapId": 820,
"prize": [
{
"a": "item",
"t": "4",
"a": "attr",
"t": "rmbmoney",
"n": 100
}
],
@ -1070,8 +1070,8 @@
"mapId": 830,
"prize": [
{
"a": "attr",
"t": "rmbmoney",
"a": "item",
"t": "4",
"n": 5
}
],
@ -1109,8 +1109,8 @@
"mapId": 860,
"prize": [
{
"a": "item",
"t": "4",
"a": "attr",
"t": "rmbmoney",
"n": 100
}
],
@ -1135,8 +1135,8 @@
"mapId": 880,
"prize": [
{
"a": "attr",
"t": "rmbmoney",
"a": "item",
"t": "4",
"n": 5
}
],
@ -1161,8 +1161,8 @@
"mapId": 900,
"prize": [
{
"a": "item",
"t": "4",
"a": "attr",
"t": "rmbmoney",
"n": 100
}
],
@ -1200,8 +1200,8 @@
"mapId": 930,
"prize": [
{
"a": "attr",
"t": "rmbmoney",
"a": "item",
"t": "4",
"n": 5
}
],
@ -1213,8 +1213,8 @@
"mapId": 940,
"prize": [
{
"a": "item",
"t": "4",
"a": "attr",
"t": "rmbmoney",
"n": 100
}
],
@ -1298,5 +1298,109 @@
],
"chapter": 14,
"des": "intr_guanqia_des_1"
},
"101": {
"id": 101,
"mapId": 1010,
"prize": [
{
"a": "attr",
"t": "rmbmoney",
"n": 100
}
],
"chapter": 14,
"des": "intr_guanqia_des_1"
},
"102": {
"id": 102,
"mapId": 1020,
"prize": [
{
"a": "attr",
"t": "rmbmoney",
"n": 100
}
],
"chapter": 14,
"des": "intr_guanqia_des_1"
},
"103": {
"id": 103,
"mapId": 1030,
"prize": [
{
"a": "item",
"t": "4",
"n": 5
}
],
"chapter": 14,
"des": "intr_guanqia_des_1"
},
"104": {
"id": 104,
"mapId": 1040,
"prize": [
{
"a": "attr",
"t": "rmbmoney",
"n": 100
}
],
"chapter": 14,
"des": "intr_guanqia_des_1"
},
"105": {
"id": 105,
"mapId": 1050,
"prize": [
{
"a": "attr",
"t": "rmbmoney",
"n": 100
}
],
"chapter": 14,
"des": "intr_guanqia_des_1"
},
"106": {
"id": 106,
"mapId": 1060,
"prize": [
{
"a": "attr",
"t": "rmbmoney",
"n": 100
}
],
"chapter": 14,
"des": "intr_guanqia_des_1"
},
"107": {
"id": 107,
"mapId": 1070,
"prize": [
{
"a": "attr",
"t": "rmbmoney",
"n": 100
}
],
"chapter": 14,
"des": "intr_guanqia_des_1"
},
"108": {
"id": 108,
"mapId": 1080,
"prize": [
{
"a": "item",
"t": "4",
"n": 5
}
],
"chapter": 14,
"des": "intr_guanqia_des_1"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -16,4 +16,6 @@ export type ResOpen = {
payNum: number;
/**活动信息 */
hdinfo: ReqAddHuoDong;
/** 当前领取轮次 */
round: number
};

View File

@ -10263,6 +10263,13 @@ export const serviceProto: ServiceProto<ServiceType> = {
"type": "Reference",
"target": "../../monopoly/protocols/PtlAddHuoDong/ReqAddHuoDong"
}
},
{
"id": 4,
"name": "round",
"type": {
"type": "Number"
}
}
]
},