This commit is contained in:
aozhiwei 2022-04-17 10:42:17 +08:00
parent 560bc927ab
commit 7a77de53db

View File

@ -33,10 +33,8 @@ class Present extends BaseService {
async processList(name, list) {
for (let i in list){
const presentMeta = list[i];
console.log(presentMeta);
const randItem = presentMeta.randItem();
if (randItem) {
console.log(11111);
const itemId = randItem['itemId'];
const tokenType = randItem['tokenType'];
for (let ii = 0; ii < presentMeta.getCount(); ++ii) {
@ -62,24 +60,26 @@ class Present extends BaseService {
1,
idx
);
console.log(tokenId, presentMeta);
const fieldsList = [
['bc_mint_tokenid', tokenId],
['batch_id', name],
['row_id', presentMeta['id']],
['seq_id', seqId],
['account', bcutils.toNormalAddress(presentMeta['account'])],
['game_id', this.gameId],
['bc_mint_itemid', itemId],
['bc_mint_token_type', tokenType],
['bc_mint_tags', presentMeta.getTags()],
['createtime', this.nowTime],
['modifytime', this.nowTime]
];
log.info('insert t_present ', utils.jsonEncode(fieldsList));
const {err} = await this.conn.insert(
't_present',
[
['bc_mint_tokenid', tokenId],
['batch_id', name],
['row_id', presentMeta['id']],
['seq_id', seqId],
['account', bcutils.toNormalAddress(presentMeta['account'])],
['game_id', this.gameId],
['bc_mint_itemid', itemId],
['bc_mint_token_type', tokenType],
['bc_mint_tags', presentMeta.getTags()],
['createtime', this.nowTime],
['modifytime', this.nowTime]
]
fieldsList
);
}
}