From 3e2caf9308b167baaedc3772688181131aadc25d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=B9=A6=E7=86=A0?= Date: Wed, 26 Jun 2024 14:08:17 +0800 Subject: [PATCH] optimize. (#265) --- explorer/src/service/v2/other.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/explorer/src/service/v2/other.rs b/explorer/src/service/v2/other.rs index 6fadfcb..c37711f 100644 --- a/explorer/src/service/v2/other.rs +++ b/explorer/src/service/v2/other.rs @@ -179,6 +179,7 @@ pub struct AddressCountParams { pub start_time: Option, pub end_time: Option, } + #[derive(Serialize, Deserialize)] pub struct AddressCountResponse { count: i64, @@ -192,10 +193,10 @@ pub async fn get_address_count( let mut query_params: Vec = vec![]; if let Some(start_time) = params.start_time { - query_params.push(format!("timestamp > {start_time} ")); + query_params.push(format!("timestamp >= {start_time} ")); } if let Some(end_time) = params.end_time { - query_params.push(format!("timestamp < {end_time} ")); + query_params.push(format!("timestamp <= {end_time} ")); } let mut sql_native = "SELECT count(distinct address) FROM native_addrs ".to_string();