Compare commits
5 Commits
479c309481
...
944a675af3
Author | SHA1 | Date | |
---|---|---|---|
![]() |
944a675af3 | ||
![]() |
6fa3a8224c | ||
![]() |
2e84333776 | ||
![]() |
add9c7c562 | ||
![]() |
837e9b58c8 |
@ -22,10 +22,7 @@ export default async function (call: ApiCall<ReqTaskRec, ResTaskRec>) {
|
||||
return call.error('', { code: -3, message: globalThis.lng.yangchengmubiao_4 })
|
||||
}
|
||||
_mydata.taskfinish.push(taskid)
|
||||
let _addval = _con.addval
|
||||
let _setData = {}
|
||||
_mydata["val"] += _addval
|
||||
_setData["val"] = _mydata.val
|
||||
_setData["taskfinish"] = _mydata.taskfinish
|
||||
await Yuandanfun.setData(call.uid, _hd.hdid, { $set: _setData })
|
||||
let _prize = _con.prize
|
||||
|
@ -23,6 +23,7 @@ export class Yuandanfun {
|
||||
exchange: {},
|
||||
taskfinish: [],
|
||||
taskval: await this.getTaskVal(call),
|
||||
qiandaoTime: data?.qiandaoTime || 0,
|
||||
refreshTime: G.time
|
||||
},
|
||||
}, {upsert: true, returnDocument: 'after'})).value
|
||||
@ -40,7 +41,7 @@ export class Yuandanfun {
|
||||
let _tmp = _tasks[element]
|
||||
_tmp["id"] = element
|
||||
// 每日登录直接完成
|
||||
if (element == "1") {
|
||||
if (_tmp.stype == "128") {
|
||||
_res[element] = 1
|
||||
} else {
|
||||
_res[element] = 0
|
||||
@ -59,8 +60,7 @@ export class Yuandanfun {
|
||||
|
||||
/**设置任务 */
|
||||
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)
|
||||
// if (hdids.length <= 0) return // 活动过期,不计数
|
||||
// 活动过期,不计数
|
||||
let _hd = await this.getCon(call)
|
||||
if (!_hd) return
|
||||
|
||||
@ -95,8 +95,8 @@ export class Yuandanfun {
|
||||
|
||||
// 设置任务
|
||||
if (isset == 1) {
|
||||
await G.mongodb.collection('event').updateMany(
|
||||
{uid: call.uid, type: {$regex: `yuandan${_hd.hdid}`}},
|
||||
await G.mongodb.collection('event').updateOne(
|
||||
{uid: call.uid, type: `yuandan${_hd.hdid}`},
|
||||
_setData
|
||||
)
|
||||
}
|
||||
|
@ -392,7 +392,7 @@ export class HuoDongHongDianFun {
|
||||
|
||||
if (data?.gameNum < _hd.data.gamefree) return {show: true}
|
||||
|
||||
if (!PublicShared.chkSameDate(data.qiandaoTime || 0, G.time)) {
|
||||
if (!PublicShared.chkSameDate(data?.qiandaoTime || 0, G.time)) {
|
||||
return {show: true}
|
||||
}
|
||||
|
||||
|
@ -840,8 +840,7 @@ export class TaskAllEmitFun {
|
||||
|
||||
if (node.call.service.name == 'event/yuandan/DMRec' && node.return.isSucc) {
|
||||
// 今日参与{1}次抓娃娃小游戏
|
||||
let _val = node.call.conn.gud.helpHeros.length;
|
||||
G.emit("Class_task_158", 'Class_task_158', node.call, _val, 0);
|
||||
G.emit("Class_task_158", 'Class_task_158', node.call, 1, 0);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user