diff --git a/app/models/daily_statistic.rb b/app/models/daily_statistic.rb index 58e6f12ee..40f3b863b 100644 --- a/app/models/daily_statistic.rb +++ b/app/models/daily_statistic.rb @@ -414,7 +414,8 @@ def liquidity define_logic :activity_address_contract_distribution do block_ids = blocks_in_current_period.pluck(:id) - results = CellOutput.joins(:lock_script).established_status.where(block_id: block_ids).group(:code_hash).count + uniq_address_ids = CellOutput.established_status.where(block_id: block_ids).select(:address_id).distinct.map { |cell_output| cell_output.address_id } + results = Address.joins(:lock_script).where(id: uniq_address_ids).group(:code_hash).count parsed_results = results.each_with_object({}) do |(key, value), hash| hex_key = "0x#{key.unpack1('H*')}" diff --git a/db/structure.sql b/db/structure.sql index 4549df9a5..71afee4d2 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -6306,8 +6306,11 @@ INSERT INTO "schema_migrations" (version) VALUES ('20241212022531'), ('20241213053309'), ('20241218085721'), +<<<<<<< HEAD ('20241223023654'), ('20241223060331'), +======= +>>>>>>> issue-804 ('20241225045757');