Merge branch 'feature/yuandan' into dev
# Conflicts: # src/shared/protocols/serviceProto.ts
This commit is contained in:
commit
6af6eec94d
@ -7,5 +7,10 @@ import {Yuandanfun} from "./fun";
|
|||||||
export default async function (call: ApiCall<ReqOpen, ResOpen>) {
|
export default async function (call: ApiCall<ReqOpen, ResOpen>) {
|
||||||
let _hd = await Yuandanfun.getCon(call)
|
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)
|
||||||
|
})
|
||||||
}
|
}
|
@ -21,8 +21,8 @@ export class Yuandanfun {
|
|||||||
gameNum: 0,
|
gameNum: 0,
|
||||||
gift: {},
|
gift: {},
|
||||||
exchange: {},
|
exchange: {},
|
||||||
taskfinish: data?.taskfinish || [],
|
taskfinish: [],
|
||||||
taskval: await this.getTaskVal(call, hdid),
|
taskval: await this.getTaskVal(call),
|
||||||
},
|
},
|
||||||
}, {upsert: true, returnDocument: 'after'})).value
|
}, {upsert: true, returnDocument: 'after'})).value
|
||||||
}
|
}
|
||||||
@ -30,9 +30,9 @@ export class Yuandanfun {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**获取所有taskid 及对应的值 */
|
/**获取所有taskid 及对应的值 */
|
||||||
static async getTaskVal(call: ApiCall, hdid: number) {
|
static async getTaskVal(call: ApiCall) {
|
||||||
let _initCon = await this.getCon(call)
|
let _initCon = await this.getCon(call)
|
||||||
let _tasks = _initCon[hdid].data.task
|
let _tasks = _initCon.data.task
|
||||||
let _res = {}
|
let _res = {}
|
||||||
for (let index = 0; index < Object.keys(_tasks).length; index++) {
|
for (let index = 0; index < Object.keys(_tasks).length; index++) {
|
||||||
const element = Object.keys(_tasks)[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) {
|
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)
|
// let hdids = await this.gethdids(call)
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
* 元旦
|
* 元旦
|
||||||
*/
|
*/
|
||||||
export type ReqOpen = {
|
export type ReqOpen = {
|
||||||
id: string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ResOpen = {
|
export type ResOpen = {
|
||||||
|
Loading…
Reference in New Issue
Block a user