Merge branch 'feature/yuandan' into dev

# Conflicts:
#	src/shared/protocols/serviceProto.ts
This commit is contained in:
dy 2023-12-26 15:27:21 +08:00
commit 6af6eec94d
3 changed files with 10 additions and 38 deletions

View File

@ -7,5 +7,10 @@ import {Yuandanfun} from "./fun";
export default async function (call: ApiCall<ReqOpen, ResOpen>) {
let _hd = await Yuandanfun.getCon(call)
call.succ((await G.mongodb.cEvent(`yuandan${_hd.hdid}`).findOne({uid: call.uid, type: `yuandan${_hd.hdid}`})) || {})
let payIds = _hd.data.gift.filter(i => i.payid).map(i => i.payid)
call.succ({
data: await Yuandanfun.getData(call, _hd.hdid),
payLog: await PayFun.getPayLogs(call.uid, payIds)
})
}

View File

@ -21,8 +21,8 @@ export class Yuandanfun {
gameNum: 0,
gift: {},
exchange: {},
taskfinish: data?.taskfinish || [],
taskval: await this.getTaskVal(call, hdid),
taskfinish: [],
taskval: await this.getTaskVal(call),
},
}, {upsert: true, returnDocument: 'after'})).value
}
@ -30,9 +30,9 @@ export class Yuandanfun {
}
/**获取所有taskid 及对应的值 */
static async getTaskVal(call: ApiCall, hdid: number) {
static async getTaskVal(call: ApiCall) {
let _initCon = await this.getCon(call)
let _tasks = _initCon[hdid].data.task
let _tasks = _initCon.data.task
let _res = {}
for (let index = 0; index < Object.keys(_tasks).length; index++) {
const element = Object.keys(_tasks)[index];
@ -56,38 +56,6 @@ export class Yuandanfun {
)
}
// /**刷新每日任务 */
// static async refreTask(call: ApiCall, mydata, hdid: number) {
// let _initCon = await this.getCon(call)
// let _con = _initCon[hdid].data.task
// if (!_con) return mydata
// mydata.taskfinish = []
// mydata.taskval = await this.getTaskVal(call, hdid)
// mydata.refresh = G.time
// mydata.gamenum = 0
// mydata.libao = {}
//
// (await G.mongodb.cEvent(`yuandan${hdid}`).findOneAndUpdate({uid: call.uid, type: `yuandan${hdid}`}, {
// $set: {
// gameNum: 0,
// gift: {},
// exchange: {},
// },
// }, {upsert: true, returnDocument: 'after'})).value
//
// await this.setMyData(call.uid, hdid, {
// $set: {
// refreshTime: mydata.refreshTime,
// taskfinish: mydata.taskfinish,
// taskval: mydata.taskval,
// gamenum: mydata.gamenum,
// libao: mydata.libao
// }
// })
// return mydata
// }
/**设置任务 */
static async setTaskVal(call: ApiCall, stype: number, val: number, chkCall: Function, chkval: number = 0, isinc: number = 0, alchangeVal: Function, arg) {
// let hdids = await this.gethdids(call)

View File

@ -2,7 +2,6 @@
*
*/
export type ReqOpen = {
id: string
}
export type ResOpen = {