From 70dc13392186f57dd796106783fa0d1ce0f2b98e Mon Sep 17 00:00:00 2001 From: leej1012 Date: Mon, 23 Dec 2024 15:41:08 +0800 Subject: [PATCH] Update queryAddressSendTxInfo --- back-end-projects/Explorer/config/application-dev.properties | 2 +- .../src/main/java/com/github/ontio/config/ParamsConfig.java | 3 +++ .../github/ontio/service/impl/ActivityDataServiceImpl.java | 5 ++--- .../Explorer/src/main/resources/mapper/TxDetailMapper.xml | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/back-end-projects/Explorer/config/application-dev.properties b/back-end-projects/Explorer/config/application-dev.properties index 1570b4e2..412d3269 100644 --- a/back-end-projects/Explorer/config/application-dev.properties +++ b/back-end-projects/Explorer/config/application-dev.properties @@ -81,5 +81,5 @@ eth.web3j.url=http://polaris1.ont.io:20339 recaptcha.secret.key= -#block.end.2024 = 612800 +block.start.2024 =16980451 block.end.2024 = 18316350 \ No newline at end of file diff --git a/back-end-projects/Explorer/src/main/java/com/github/ontio/config/ParamsConfig.java b/back-end-projects/Explorer/src/main/java/com/github/ontio/config/ParamsConfig.java index 962990e0..baa4d9db 100644 --- a/back-end-projects/Explorer/src/main/java/com/github/ontio/config/ParamsConfig.java +++ b/back-end-projects/Explorer/src/main/java/com/github/ontio/config/ParamsConfig.java @@ -178,6 +178,9 @@ public String getContractHash(String token) { @Value("${recaptcha.secret.key}") public String RECAPTCHA_SECRET_KEY; + @Value("${block.start.2024}") + public int BLOCK_START_2024; + @Value("${block.end.2024}") public int BLOCK_END_2024; } \ No newline at end of file diff --git a/back-end-projects/Explorer/src/main/java/com/github/ontio/service/impl/ActivityDataServiceImpl.java b/back-end-projects/Explorer/src/main/java/com/github/ontio/service/impl/ActivityDataServiceImpl.java index 806d4fee..f694a5a6 100644 --- a/back-end-projects/Explorer/src/main/java/com/github/ontio/service/impl/ActivityDataServiceImpl.java +++ b/back-end-projects/Explorer/src/main/java/com/github/ontio/service/impl/ActivityDataServiceImpl.java @@ -154,10 +154,9 @@ public JSONObject queryAddressActiveTime(String address) { @Override public JSONObject queryAddressSendTxInfo(String address) { int firstTxTime = 0; - int startBlock2024 = 16980450; - int txCount = txDetailMapper.selectSendTxCountByBlockHeight(address, startBlock2024, paramsConfig.BLOCK_END_2024); + int txCount = txDetailMapper.selectSendTxCountByBlockHeight(address, paramsConfig.BLOCK_START_2024, paramsConfig.BLOCK_END_2024); if (txCount > 0) { - TxDetailDto txDetailDto = txDetailMapper.selectFirstSendTxByBlockHeight(address, startBlock2024, paramsConfig.BLOCK_END_2024); + TxDetailDto txDetailDto = txDetailMapper.selectFirstSendTxByBlockHeight(address, paramsConfig.BLOCK_START_2024, paramsConfig.BLOCK_END_2024); if (txDetailDto != null) { firstTxTime = txDetailDto.getTxTime(); } diff --git a/back-end-projects/Explorer/src/main/resources/mapper/TxDetailMapper.xml b/back-end-projects/Explorer/src/main/resources/mapper/TxDetailMapper.xml index ce6778c5..be146046 100644 --- a/back-end-projects/Explorer/src/main/resources/mapper/TxDetailMapper.xml +++ b/back-end-projects/Explorer/src/main/resources/mapper/TxDetailMapper.xml @@ -668,7 +668,7 @@ SELECT COUNT(DISTINCT tx_hash) FROM tbl_tx_detail WHERE from_address = #{address} - AND block_height > #{startBlock} + AND block_height >= #{startBlock} AND block_height #{endBlock}; @@ -677,7 +677,7 @@ FROM tbl_tx_detail WHERE from_address = #{address} - AND block_height > #{startBlock} + AND block_height >= #{startBlock} AND block_height #{endBlock} ORDER BY block_height LIMIT 1