From 2b963de85caa29e85c5f4dd64dc9813754e8050a Mon Sep 17 00:00:00 2001 From: Miles Zhang Date: Tue, 23 Jan 2024 10:52:47 +0800 Subject: [PATCH] fix: default sort by block_timestamp of omiga inscription same type hash (#1602) Signed-off-by: Miles Zhang --- app/controllers/api/v1/omiga_inscriptions_controller.rb | 2 +- .../csv_exportable/export_omiga_inscription_transactions_job.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/api/v1/omiga_inscriptions_controller.rb b/app/controllers/api/v1/omiga_inscriptions_controller.rb index 44f1e95ec..e9785bcf0 100644 --- a/app/controllers/api/v1/omiga_inscriptions_controller.rb +++ b/app/controllers/api/v1/omiga_inscriptions_controller.rb @@ -38,7 +38,7 @@ def show else Udt.joins(:omiga_inscription_info).where( "udts.type_hash = ? or omiga_inscription_infos.type_hash = ?", params[:id], params[:id] - ).order("id DESC").first + ).order("block_timestamp DESC").first end if udt.nil? diff --git a/app/jobs/csv_exportable/export_omiga_inscription_transactions_job.rb b/app/jobs/csv_exportable/export_omiga_inscription_transactions_job.rb index 343b1f003..3090a962b 100644 --- a/app/jobs/csv_exportable/export_omiga_inscription_transactions_job.rb +++ b/app/jobs/csv_exportable/export_omiga_inscription_transactions_job.rb @@ -9,7 +9,7 @@ def perform(args) else Udt.joins(:omiga_inscription_info).where( "udts.type_hash = ? or omiga_inscription_infos.type_hash = ?", args[:id], args[:id] - ).order("id DESC").first + ).order("block_timestamp DESC").first end ckb_transactions = udt.ckb_transactions