Compare commits

..

No commits in common. "8d9ecf30b61c8d15ac178d92c9604bfcb8df3d32" and "d490550abf0c56b05a445fd546ede0806b9d09c1" have entirely different histories.

4 changed files with 7 additions and 11 deletions

View File

@ -32,7 +32,7 @@ export default async function (call: ApiCall<Reqdetails, Resdetails>) {
let _tmp = {
ranking: index,
participantId: elementUser.uid,
value: await (await PayFun.getPayDaysAllPayNum(elementUser.uid, element.stime, element.etime)).toString()
value: await (await PayFun.getPayDaysAllPayNum(elementUser.uid, element.stime, element.rtime)).toString()
}
accountingData.push(_tmp)
}

View File

@ -23,7 +23,7 @@ export default async function (call: ApiCall<ReqOpen, ResOpen>) {
{upsert: true}
);
}
db = await checkNextRound(call, db, _hdinfo)
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

View File

@ -20,7 +20,7 @@ export default async function (call: ApiCall<ReqRec, ResRec>) {
let db = await G.mongodb.cEvent(_dbType).findOne({uid: call.uid, type: _dbType});
if (db.recIndex.includes(call.req.index)) return call.error('', {code: -2});
let payNum = (await PayFun.getPayDaysAllPayNum(call.uid, _hdinfo.stime, _hdinfo.etime)) * 10;
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});
@ -31,7 +31,7 @@ export default async function (call: ApiCall<ReqRec, ResRec>) {
{$push: {recIndex: call.req.index}}
);
await checkNextRound(call, db, _hdinfo)
await checkNextRound(call, db, _hdinfo.data.tasks)
HongDianChange.sendChangeKey(call.uid, ['huodonghd'])
call.succ({
@ -39,13 +39,9 @@ export default async function (call: ApiCall<ReqRec, ResRec>) {
});
}
export async function checkNextRound(call: ApiCall, event, _hdinfo) {
if ((event?.recIndex?.length || 0) < _hdinfo.data.tasks.length) return event
let payNum = (await PayFun.getPayDaysAllPayNum(call.uid, _hdinfo.stime, _hdinfo.etime)) * 10
payNum = payNum - (event?.round || 0) * R.sort((a, b) => b.total - a.total)(_hdinfo.data.tasks)[0].total
if (payNum < 0) return event
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'}

View File

@ -656,7 +656,7 @@ export class HuoDongHongDianFun {
let _con = hdCon.data.tasks;
let db = await G.mongodb.cEvent(_dbType).findOne({uid: call.uid, type: _dbType});
let _mydata = db || {sTime: PublicShared.getToDayZeroTime(G.time), recIndex: []};
let payNum = await PayFun.getPayDaysAllPayNum(call.uid, hdCon.stime, hdCon.etime);
let payNum = await PayFun.getPayDaysAllPayNum(call.uid, hdCon.stime, hdCon.rtime);
for (let index = 0; index < _con.length; index++) {
const element = _con[index];
if (_mydata.recIndex.includes(index)) continue;