Merge branch 'feature/xiaofeijingsai' into dev
# Conflicts: # src/shared/protocols/serviceProto.ts
This commit is contained in:
commit
2ade418245
29
src/api_s2c/event/xiaofeijingsai/ApiOpen.ts
Normal file
29
src/api_s2c/event/xiaofeijingsai/ApiOpen.ts
Normal 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})
|
||||||
|
}
|
8
src/shared/protocols/event/xiaofeijingsai/PtlOpen.ts
Normal file
8
src/shared/protocols/event/xiaofeijingsai/PtlOpen.ts
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
/**
|
||||||
|
* 消费竞赛
|
||||||
|
*/
|
||||||
|
export type ReqOpen = {};
|
||||||
|
|
||||||
|
export type ResOpen = {
|
||||||
|
list: any[]
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user