mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Some code cleanup.
This commit is contained in:
@@ -489,17 +489,17 @@ class CategoryRepository implements CategoryRepositoryInterface
|
||||
if ($accounts->count() > 0) {
|
||||
$accountIds = $accounts->pluck('id')->toArray();
|
||||
$query->where(
|
||||
// source.account_id in accountIds XOR destination.account_id in accountIds
|
||||
function (Builder $sourceXorDestinationQuery) use ($accountIds) {
|
||||
$sourceXorDestinationQuery->where(
|
||||
function (Builder $inSourceButNotDestinationQuery) use ($accountIds) {
|
||||
$inSourceButNotDestinationQuery->whereIn('source.account_id', $accountIds)
|
||||
->whereNotIn('destination.account_id', $accountIds);
|
||||
// source.account_id in accountIds XOR destination.account_id in accountIds
|
||||
function (Builder $query) use ($accountIds) {
|
||||
$query->where(
|
||||
function (Builder $q1) use ($accountIds) {
|
||||
$q1->whereIn('source.account_id', $accountIds)
|
||||
->whereNotIn('destination.account_id', $accountIds);
|
||||
}
|
||||
)->orWhere(
|
||||
function (Builder $inDestinationButNotSourceQuery) use ($accountIds) {
|
||||
$inDestinationButNotSourceQuery->whereIn('destination.account_id', $accountIds)
|
||||
->whereNotIn('source.account_id', $accountIds);
|
||||
function (Builder $q2) use ($accountIds) {
|
||||
$q2->whereIn('destination.account_id', $accountIds)
|
||||
->whereNotIn('source.account_id', $accountIds);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@@ -71,7 +71,7 @@ interface CategoryRepositoryInterface
|
||||
public function findByName(string $name) : Category;
|
||||
|
||||
/**
|
||||
* @param Category $category
|
||||
* @param Category $category
|
||||
*
|
||||
* @return Carbon
|
||||
*/
|
||||
|
Reference in New Issue
Block a user