From 15c66652a8c3daebc8a533010174a3f2c5be64c5 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Tue, 24 Sep 2019 15:55:31 +0300 Subject: [PATCH] fix query --- apps/explorer/lib/explorer/chain.ex | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/explorer/lib/explorer/chain.ex b/apps/explorer/lib/explorer/chain.ex index 6abd211335..248482b3bc 100644 --- a/apps/explorer/lib/explorer/chain.ex +++ b/apps/explorer/lib/explorer/chain.ex @@ -3163,9 +3163,11 @@ defmodule Explorer.Chain do def erc721_token_instance_from_token_id_and_token_address(token_id, token_contract_address) do query = from(tt in TokenTransfer, + left_join: instance in Instance, + on: tt.token_contract_address_hash == instance.token_contract_address_hash and tt.token_id == instance.token_id, where: tt.token_contract_address_hash == ^token_contract_address and tt.token_id == ^token_id, - preload: [:instance], - limit: 1 + limit: 1, + select: %{tt | instance: instance} ) case Repo.one(query) do