This commit is contained in:
aozhiwei 2023-06-13 15:24:04 +08:00
parent aea511335b
commit efa89241b0
2 changed files with 36 additions and 0 deletions

View File

@ -12,6 +12,7 @@ function add(clsName, modName) {
function init() {
add('Transaction', 'transaction');
add('Log', 'log');
add('UsedTokenId', 'used_tokenid');
}
function create(name, session) {

View File

@ -0,0 +1,35 @@
const utils = require('j7/utils');
const BaseModel = require('./basemodel');
class UsedTokenId extends BaseModel {
async add(params) {
const result = {
err: null,
seqId: 0
};
const nowTime = utils.getUtcTime();
const fields = [
['type', params['type']],
['subType', params['sub_type']],
['net_id', params['net_id']],
['createtime', nowTime],
['modifytime', nowTime],
];
for (i = 1; i <= 4; ++i) {
const key = 'param' + i;
if (utils.hasKey(params, key)) {
fields.push([key, params[key]]);
}
}
await this.getSession().marketConn
(
'insert',
't_used_token_id',
fields
);
}
}
module.exports = UsedTokenId;