fix 脚本
This commit is contained in:
parent
37f2472f5d
commit
6a0a158fba
@ -17,7 +17,7 @@ class Path {
|
|||||||
|
|
||||||
console.log('这是第1个脚本执行完成')
|
console.log('这是第1个脚本执行完成')
|
||||||
|
|
||||||
return 12
|
return _hd
|
||||||
}
|
}
|
||||||
|
|
||||||
@patchFun
|
@patchFun
|
||||||
@ -36,26 +36,28 @@ class Path {
|
|||||||
|
|
||||||
console.log('这是第2个脚本执行完成')
|
console.log('这是第2个脚本执行完成')
|
||||||
|
|
||||||
return 12
|
return _hd
|
||||||
}
|
}
|
||||||
|
|
||||||
@patchFun
|
@patchFun
|
||||||
async fun3(a: any) {
|
async fun3(a: any) {
|
||||||
//这里执行脚本的内容,加了patchFun的函数,不允许重复执行
|
//这里执行脚本的内容,加了patchFun的函数,不允许重复执行
|
||||||
console.log("这是第3个脚本里内容");
|
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.length) {
|
||||||
|
|
||||||
if (!_hd) {
|
|
||||||
console.log('htype5没查到活动')
|
console.log('htype5没查到活动')
|
||||||
return
|
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个脚本执行完成')
|
console.log('这是第3个脚本执行完成')
|
||||||
|
|
||||||
return 12
|
return _hd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user