diff --git a/src/api_s2c/event/leijichongzhi/ApiOpen.ts b/src/api_s2c/event/leijichongzhi/ApiOpen.ts index 801ee88..75a9c9b 100644 --- a/src/api_s2c/event/leijichongzhi/ApiOpen.ts +++ b/src/api_s2c/event/leijichongzhi/ApiOpen.ts @@ -25,8 +25,8 @@ export default async function (call: ApiCall) { } 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 + 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 call.succ({ sTime: sTime, diff --git a/src/api_s2c/event/leijichongzhi/ApiRec.ts b/src/api_s2c/event/leijichongzhi/ApiRec.ts index 55f9aef..5586907 100644 --- a/src/api_s2c/event/leijichongzhi/ApiRec.ts +++ b/src/api_s2c/event/leijichongzhi/ApiRec.ts @@ -40,8 +40,9 @@ export default async function (call: ApiCall) { } 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 + + let _dbType: `leijichongzhi${number}` = `leijichongzhi${call.req.hdid}` return (await G.mongodb.cEvent(_dbType).findOneAndUpdate( {uid: call.uid, type: _dbType}, {$set: {recIndex: []}, $inc: {round: 1}}, {returnDocument: 'after'} diff --git a/src/api_s2c/event/xiaofeijingsai/ApiOpen.ts b/src/api_s2c/event/xiaofeijingsai/ApiOpen.ts index 388b550..81a903a 100644 --- a/src/api_s2c/event/xiaofeijingsai/ApiOpen.ts +++ b/src/api_s2c/event/xiaofeijingsai/ApiOpen.ts @@ -72,7 +72,17 @@ async function getMyData(call: ApiCall, rankList) { }) 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) { myCut = {_id: myUser.uid, total: 0} diff --git a/src/api_s2c/eventlist/ApihdGetList.ts b/src/api_s2c/eventlist/ApihdGetList.ts index dd2934b..3cbdfa4 100644 --- a/src/api_s2c/eventlist/ApihdGetList.ts +++ b/src/api_s2c/eventlist/ApihdGetList.ts @@ -14,6 +14,16 @@ export default async function (call: ApiCall) { if (G.huodong.xfjs) { G.huodong.xfjsId = _hdList.find(i => i.htype == 11).hdid 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}) } } \ No newline at end of file diff --git a/src/public/player.ts b/src/public/player.ts index 2647bce..44ba9d0 100644 --- a/src/public/player.ts +++ b/src/public/player.ts @@ -231,12 +231,16 @@ export class PlayerFun { atn } G.mongodb.collection('rmbuse').insertOne(data); - // 消费竞赛开启时写入跨服数据库 - if (G.huodong.xfjs && !data.isAdd && typeof data.change == 'number') { - G.crossmongodb.collection('rmbuse').updateOne({uid: data.uid, type: `xfjs_${G.huodong.xfjsId}`}, { - $set: {time: G.time}, - $inc: {change: data.change} - }, {upsert: true}); + if (data.isAdd){ + ActionLog.addDayLog(uid, { key: 'addRmbmoney', val: atn.n }); + }else { + // 消费竞赛开启时写入跨服数据库 + if (G.huodong.xfjs && typeof data.change == 'number') { + G.crossmongodb.collection('rmbuse').updateOne({uid: data.uid, type: `xfjs_${G.huodong.xfjsId}`}, { + $set: {time: G.time}, + $inc: {change: data.change} + }, {upsert: true}); + } } }