fix 脚本

This commit is contained in:
dy 2023-12-28 17:33:08 +08:00
parent 37f2472f5d
commit 6a0a158fba

View File

@ -17,7 +17,7 @@ class Path {
console.log('这是第1个脚本执行完成')
return 12
return _hd
}
@patchFun
@ -36,26 +36,28 @@ class Path {
console.log('这是第2个脚本执行完成')
return 12
return _hd
}
@patchFun
async fun3(a: any) {
//这里执行脚本的内容加了patchFun的函数不允许重复执行
console.log("这是第3个脚本里内容");
let _hd = G.gc.huodong.filter(i => i.htype == 5)
let _hd = G.gc.huodong.find(i => i.htype == 5)
if (!_hd) {
if (!_hd.length) {
console.log('htype5没查到活动')
return
}
await G.mongodb.collection('hdinfo').updateMany({htype: 5}, {$set: {data: _hd.data}})
_hd.map(i => {
// @ts-ignore
G.mongodb.collection('hdinfo').updateOne({hdid: i.hdid}, {$set: {...i}}, {upsert: true})
})
console.log('这是第3个脚本执行完成')
return 12
return _hd
}