Compare commits
5 Commits
78c306ce5e
...
8f0c24bc87
Author | SHA1 | Date | |
---|---|---|---|
![]() |
8f0c24bc87 | ||
![]() |
1fcedaff59 | ||
![]() |
a1c7f2e4d0 | ||
![]() |
953303d9a4 | ||
![]() |
d2ddc62752 |
@ -25,8 +25,8 @@ export default async function (call: ApiCall<ReqOpen, ResOpen>) {
|
|||||||
}
|
}
|
||||||
db = await checkNextRound(call, db, _hdinfo.data.tasks)
|
db = await checkNextRound(call, db, _hdinfo.data.tasks)
|
||||||
|
|
||||||
let payNum = (await PayFun.getPayDaysAllPayNum(call.uid, _hdinfo.stime, _hdinfo.rtime)) * 10
|
let payNum = (await PayFun.getPayDaysAllPayNum(call.uid, _hdinfo.stime, _hdinfo.etime)) * 10
|
||||||
payNum = payNum - (db.round || 0) * R.sort((a, b) => b.total - a.total)(_hdinfo.data.tasks)[0].total
|
payNum = payNum - (db?.round || 0) * R.sort((a, b) => b.total - a.total)(_hdinfo.data.tasks)[0].total
|
||||||
|
|
||||||
call.succ({
|
call.succ({
|
||||||
sTime: sTime,
|
sTime: sTime,
|
||||||
|
@ -40,8 +40,9 @@ export default async function (call: ApiCall<ReqRec, ResRec>) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function checkNextRound(call: ApiCall, event, tasks) {
|
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
|
if ((event?.recIndex?.length || 0) < tasks.length) return event
|
||||||
|
|
||||||
|
let _dbType: `leijichongzhi${number}` = `leijichongzhi${call.req.hdid}`
|
||||||
return (await G.mongodb.cEvent(_dbType).findOneAndUpdate(
|
return (await G.mongodb.cEvent(_dbType).findOneAndUpdate(
|
||||||
{uid: call.uid, type: _dbType},
|
{uid: call.uid, type: _dbType},
|
||||||
{$set: {recIndex: []}, $inc: {round: 1}}, {returnDocument: 'after'}
|
{$set: {recIndex: []}, $inc: {round: 1}}, {returnDocument: 'after'}
|
||||||
|
@ -72,7 +72,17 @@ async function getMyData(call: ApiCall, rankList) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
let myUser = await G.mongodb.collection('user').findOne({uid: call.uid})
|
let myUser = await G.mongodb.collection('user').findOne({uid: call.uid})
|
||||||
G.crossmongodb.collection('huodong_user').updateOne({uid: call.uid}, {$set: myUser}, {upsert: true})
|
G.crossmongodb.collection('huodong_user').updateOne({uid: call.uid}, {
|
||||||
|
$set: {
|
||||||
|
lv: myUser.lv,
|
||||||
|
vip: myUser.vip,
|
||||||
|
name: myUser.name,
|
||||||
|
sid: myUser.sid,
|
||||||
|
nexp: myUser.nexp,
|
||||||
|
head: myUser.head,
|
||||||
|
headFrame: myUser.headFrame
|
||||||
|
}
|
||||||
|
}, {upsert: true})
|
||||||
|
|
||||||
if (!myCut) {
|
if (!myCut) {
|
||||||
myCut = {_id: myUser.uid, total: 0}
|
myCut = {_id: myUser.uid, total: 0}
|
||||||
|
@ -14,6 +14,16 @@ export default async function (call: ApiCall<ReqhdGetList, ReshdGetList>) {
|
|||||||
if (G.huodong.xfjs) {
|
if (G.huodong.xfjs) {
|
||||||
G.huodong.xfjsId = _hdList.find(i => i.htype == 11).hdid
|
G.huodong.xfjsId = _hdList.find(i => i.htype == 11).hdid
|
||||||
let myUser = await G.mongodb.collection('user').findOne({uid: call.uid})
|
let myUser = await G.mongodb.collection('user').findOne({uid: call.uid})
|
||||||
G.crossmongodb.collection('huodong_user').updateOne({uid: call.uid}, {$set: myUser}, {upsert: true})
|
G.crossmongodb.collection('huodong_user').updateOne({uid: call.uid}, {
|
||||||
|
$set: {
|
||||||
|
lv: myUser.lv,
|
||||||
|
vip: myUser.vip,
|
||||||
|
name: myUser.name,
|
||||||
|
sid: myUser.sid,
|
||||||
|
nexp: myUser.nexp,
|
||||||
|
head: myUser.head,
|
||||||
|
headFrame: myUser.headFrame
|
||||||
|
}
|
||||||
|
}, {upsert: true})
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -231,14 +231,18 @@ export class PlayerFun {
|
|||||||
atn
|
atn
|
||||||
}
|
}
|
||||||
G.mongodb.collection('rmbuse').insertOne(data);
|
G.mongodb.collection('rmbuse').insertOne(data);
|
||||||
|
if (data.isAdd){
|
||||||
|
ActionLog.addDayLog(uid, { key: 'addRmbmoney', val: atn.n });
|
||||||
|
}else {
|
||||||
// 消费竞赛开启时写入跨服数据库
|
// 消费竞赛开启时写入跨服数据库
|
||||||
if (G.huodong.xfjs && !data.isAdd && typeof data.change == 'number') {
|
if (G.huodong.xfjs && typeof data.change == 'number') {
|
||||||
G.crossmongodb.collection('rmbuse').updateOne({uid: data.uid, type: `xfjs_${G.huodong.xfjsId}`}, {
|
G.crossmongodb.collection('rmbuse').updateOne({uid: data.uid, type: `xfjs_${G.huodong.xfjsId}`}, {
|
||||||
$set: {time: G.time},
|
$set: {time: G.time},
|
||||||
$inc: {change: data.change}
|
$inc: {change: data.change}
|
||||||
}, {upsert: true});
|
}, {upsert: true});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static async changeAttr(uid: string, change: Partial<player>) {
|
static async changeAttr(uid: string, change: Partial<player>) {
|
||||||
setGud(uid, change);
|
setGud(uid, change);
|
||||||
|
Loading…
Reference in New Issue
Block a user