消费竞赛

This commit is contained in:
dy 2023-12-20 16:07:59 +08:00
parent 145c1ef8fe
commit 4631cba0b3
5 changed files with 2191 additions and 413 deletions

1792
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -41,6 +41,7 @@
"json5": "^2.2.3",
"mathjs": "^11.4.0",
"mongodb": "^4.17.1",
"node-gyp": "^10.0.1",
"ramda": "^0.29.1",
"redis": "^4.3.1",
"shelljs": "^0.8.5",

View File

@ -0,0 +1,29 @@
import {ApiCall} from "tsrpc";
import {ReqOpen, ResOpen} from "../../../shared/protocols/event/xiaofeijingsai/PtlOpen";
import {PayFun} from "../../../public/pay";
import {HuoDongFun} from "../../../public/huodongfun";
import {PublicShared} from "../../../shared/public/public";
export default async function (call: ApiCall<ReqOpen, ResOpen>) {
// let data = await G.mongodb.cEvent('zhoumolibao').findOne({uid: call.uid, type: 'zhoumolibao'})
//
let _hd = (await HuoDongFun.gethdList(call, 11))[0]
console.log(_hd)
//
// let payIds = _hd?.data?.gift?.filter(i => i.payId)?.map(i => i.payId)
// let a = []
let rmbuse = await G.mongodb.collection('rmbuse').aggregate([
{$match: {isAdd: false}},
{$group: {_id: "$uid", total: {$sum: "$change"}}},
{$sort: {total: 1}}
]).toArray()
let list: any = rmbuse.map(i => ({...i, total: R.negate(i.total)}))
let users = await G.mongodb.collection('user').find({uid: {$in: list.map(i => i._id)}}).toArray()
list = list.map(i => ({...i, player: users.find(v => v.uid == i._id)}))
call.succ({list})
}

View File

@ -0,0 +1,8 @@
/**
*
*/
export type ReqOpen = {};
export type ResOpen = {
list: any[]
};

File diff suppressed because it is too large Load Diff