This commit is contained in:
aozhiwei 2023-07-10 14:46:48 +08:00
parent cdaa601fc8
commit 80e76e23da
2 changed files with 18 additions and 1 deletions

View File

@ -149,6 +149,7 @@ CREATE TABLE `t_erc721_refresh` (
`contract_name` varchar(60) NOT NULL DEFAULT '' COMMENT 'contract_name',
`token_id` varchar(60) NOT NULL DEFAULT '' COMMENT 'token_id',
`status` int(11) NOT NULL DEFAULT '0' COMMENT '0: dirty',
`refresh_count` bigint NOT NULL DEFAULT '0' COMMENT 'refresh_count',
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
PRIMARY KEY (`idx`),

View File

@ -113,7 +113,9 @@ class Erc721Refresher extends BaseService {
],
[
['owner_address', bcutils.toNormalAddress(newOwner)],
['confirm_count', this.nftDb['confirm_count'] + 1],
['confirm_count', () => {
return 'confirm_count + 1';
}],
['confirm_block_number', blockNumber]
]);
if (err) {
@ -127,6 +129,20 @@ class Erc721Refresher extends BaseService {
return true;
}
async update(row, fields) {
const {err} = await this.conn.update(
't_erc721_refresh',
[
['idx', row['idx']],
['net_id', row['net_id']],
['token_id', row['token_id']],
['contract_address', row['contract_address']],
['refresh_count', row['refresh_count']],
],
fields,
);
}
}
module.exports = Erc721Refresher;