This commit is contained in:
James Cole 2016-12-17 17:09:46 +01:00
parent 560f6cbf24
commit f3398c7dec

View File

@ -113,7 +113,11 @@ class ImportStorage
private function alreadyImported(string $hash): TransactionJournal
{
$meta = TransactionJournalMeta::where('name', 'originalImportHash')->where('data', json_encode($hash))->first(['journal_meta.*']);
$meta = TransactionJournalMeta
::leftJoin('transaction_journals', 'transaction_journals.id', '=', 'journal_meta.transaction_journal_id')
->where('journal_meta.name', 'originalImportHash')
->where('transaction_journals.user_id', $this->user->id)
->where('journal_meta.data', json_encode($hash))->first(['journal_meta.*']);
if (!is_null($meta)) {
/** @var TransactionJournal $journal */
$journal = $meta->transactionjournal;