Compare commits

...

5 Commits

Author SHA1 Message Date
dy
8f0c24bc87 Merge branch 'feature/warning' into bugfix 2024-01-03 11:09:56 +08:00
dy
1fcedaff59 还原 2024-01-03 11:09:39 +08:00
dy
a1c7f2e4d0 监控init 2024-01-03 11:01:12 +08:00
dy
953303d9a4 Merge branch 'master' into feature/warning 2024-01-03 10:18:20 +08:00
dy
d2ddc62752 fix round 2024-01-02 15:49:24 +08:00
5 changed files with 36 additions and 11 deletions

View File

@ -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,

View File

@ -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'}

View File

@ -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}

View File

@ -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})
} }
} }

View File

@ -231,12 +231,16 @@ export class PlayerFun {
atn atn
} }
G.mongodb.collection('rmbuse').insertOne(data); G.mongodb.collection('rmbuse').insertOne(data);
// 消费竞赛开启时写入跨服数据库 if (data.isAdd){
if (G.huodong.xfjs && !data.isAdd && typeof data.change == 'number') { ActionLog.addDayLog(uid, { key: 'addRmbmoney', val: atn.n });
G.crossmongodb.collection('rmbuse').updateOne({uid: data.uid, type: `xfjs_${G.huodong.xfjsId}`}, { }else {
$set: {time: G.time}, // 消费竞赛开启时写入跨服数据库
$inc: {change: data.change} if (G.huodong.xfjs && typeof data.change == 'number') {
}, {upsert: true}); G.crossmongodb.collection('rmbuse').updateOne({uid: data.uid, type: `xfjs_${G.huodong.xfjsId}`}, {
$set: {time: G.time},
$inc: {change: data.change}
}, {upsert: true});
}
} }
} }