Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Experimental faster query
Sander Dorigo1820b322b3cc
diff --git a/app/Console/Commands/Correction/CorrectsGroupAccounts.php b/app/Console/Commands/Correction/CorrectsGroupAccounts.phpindex 51968680e6..572053ffb3 100644--- a/app/Console/Commands/Correction/CorrectsGroupAccounts.php+++ b/app/Console/Commands/Correction/CorrectsGroupAccounts.php@@ -49,21 +49,34 @@ class CorrectsGroupAccounts extends Command{Log::debug('Start of correction:group-accounts');$groups = [];- $res = TransactionJournal::query()->groupBy('transaction_group_id')->get([- 'transaction_group_id',- DB::raw('COUNT(transaction_group_id) as the_count'),- ]);+// $res = TransactionJournal::query()+// ->groupBy('transaction_group_id')+// ->havingRaw('the_count > 1')+// ->get([+// 'transaction_group_id',+// DB::raw('COUNT(transaction_group_id) as the_count'),+// ]);- /** @var TransactionJournal $journal */- foreach ($res as $journal) {- if ((int) $journal->the_count > 1) {- $groups[] = (int) $journal->transaction_group_id;- }- }+ $groups = TransactionJournal::query()+ ->groupBy('transaction_group_id')+ ->havingRaw('the_count > 1')+ ->get([+ 'transaction_group_id',+ DB::raw('COUNT(transaction_group_id) as the_count'),+ ])->pluck('transaction_group_id')->toArray();++// /** @var TransactionJournal $journal */+// foreach ($res as $journal) {+// if ((int) $journal->the_count > 1) {+// $groups[] = (int) $journal->transaction_group_id;+// }+// }+// var_dump($groups);+// var_dump($groups2);exit;$flags = new TransactionGroupEventFlags();$flags->applyRules = false;$flags->fireWebhooks = false;- $flags->recalculateCredit = true;+ $flags->recalculateCredit = false;$flags->unifyOnly = true;$objects = new TransactionGroupEventObjects();foreach ($groups as $groupId) {