mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-18 10:16:49 +00:00
Some last minute fixes.
This commit is contained in:
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Repositories\Journal;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use DB;
|
||||
use Exception;
|
||||
use FireflyIII\Factory\TransactionJournalFactory;
|
||||
use FireflyIII\Factory\TransactionJournalMetaFactory;
|
||||
@@ -157,11 +158,21 @@ class JournalRepository implements JournalRepositoryInterface
|
||||
*/
|
||||
public function findByHash(string $hash): ?TransactionJournalMeta
|
||||
{
|
||||
return TransactionJournalMeta
|
||||
$jsonEncode = json_encode($hash);
|
||||
$hashOfHash = hash('sha256', $jsonEncode);
|
||||
Log::debug(sprintf('JSON encoded hash is: %s', $jsonEncode));
|
||||
Log::debug(sprintf('Hash of hash is: %s', $hashOfHash));
|
||||
|
||||
$result = TransactionJournalMeta
|
||||
::leftJoin('transaction_journals', 'transaction_journals.id', '=', 'journal_meta.transaction_journal_id')
|
||||
->where('data', json_encode($hash))
|
||||
->where('hash', $hashOfHash)
|
||||
->where('name', 'importHashV2')
|
||||
->first(['journal_meta.*']);
|
||||
if (null === $result) {
|
||||
Log::debug('Result is null');
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user