Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimize. #235

Merged
merged 1 commit into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion explorer/src/service/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ impl Api {
}

#[oai(
path = "/v2/tx/prism/records/send",
path = "/v2/tx/prism/send",
method = "get",
tag = "ApiTags::Transaction"
)]
Expand Down
4 changes: 2 additions & 2 deletions explorer/src/service/v1/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,15 +206,15 @@ pub async fn get_prism_received(
let mut items: Vec<V2PrismItem> = vec![];

let sql_counts = format!(
"SELECT count(*) AS cnt FROM e2n WHERE receiver=\'{}\'",
"SELECT count(*) AS cnt FROM e2n WHERE receiver='{}'",
address.0
);
let row_counts = sqlx::query(sql_counts.as_str())
.fetch_one(&mut conn)
.await?;
let total: i64 = row_counts.try_get("cnt")?;

let sql_query = format!("SELECT tx_hash,block_hash,sender,receiver,asset,amount,decimal,height,timestamp,value FROM e2n WHERE receiver=\'{}\' ORDER BY timestamp DESC LIMIT {} OFFSET {}", address.0, page_size, (page-1)*page_size);
let sql_query = format!("SELECT tx_hash,block_hash,sender,receiver,asset,amount,decimal,height,timestamp,value FROM e2n WHERE receiver='{}' ORDER BY timestamp DESC LIMIT {} OFFSET {}", address.0, page_size, (page-1)*page_size);
let rows = sqlx::query(sql_query.as_str()).fetch_all(&mut conn).await?;
for row in rows {
let tx_hash: String = row.try_get("tx_hash")?;
Expand Down
Loading