mirror of
				https://github.com/firefly-iii/firefly-iii.git
				synced 2025-10-31 02:36:28 +00:00 
			
		
		
		
	Add new search options for https://github.com/firefly-iii/firefly-iii/issues/7571
This commit is contained in:
		| @@ -917,6 +917,7 @@ trait MetaCollection | ||||
|         $list                = $tags->pluck('tag')->toArray(); | ||||
|         $filter              = static function (array $object) use ($list): bool { | ||||
|             foreach ($object['transactions'] as $transaction) { | ||||
|                 app('log')->debug(sprintf('Transaction has %d tag(s)', count($transaction['tags']))); | ||||
|                 foreach ($transaction['tags'] as $tag) { | ||||
|                     if (in_array($tag['name'], $list, true)) { | ||||
|                         return false; | ||||
|   | ||||
| @@ -515,7 +515,6 @@ class GroupCollector implements GroupCollectorInterface | ||||
|             // add to query:
 | ||||
|             $this->query->orWhereIn('transaction_journals.transaction_group_id', $groupIds); | ||||
|         } | ||||
| 
 | ||||
|         $result = $this->query->get($this->fields); | ||||
| 
 | ||||
|         // now to parse this into an array.
 | ||||
| @@ -823,10 +822,15 @@ class GroupCollector implements GroupCollectorInterface | ||||
|     private function postFilterCollection(Collection $collection): Collection | ||||
|     { | ||||
|         $currentCollection = $collection; | ||||
| 
 | ||||
|         app('log')->debug(sprintf('GroupCollector: postFilterCollection has %d filter(s) and %d transaction(s).', count($this->postFilters), count($currentCollection))); | ||||
| 
 | ||||
| 
 | ||||
|         /** | ||||
|          * @var Closure $function | ||||
|          */ | ||||
|         foreach ($this->postFilters as $function) { | ||||
|             app('log')->debug('Applying filter...'); | ||||
|             $nextCollection = new Collection(); | ||||
|             // loop everything in the current collection
 | ||||
|             // and save it (or not) in the new collection.
 | ||||
| @@ -843,6 +847,7 @@ class GroupCollector implements GroupCollectorInterface | ||||
|                 $nextCollection->push($item); | ||||
|             } | ||||
|             $currentCollection = $nextCollection; | ||||
|             app('log')->debug(sprintf('GroupCollector: postFilterCollection has %d transaction(s) left.', count($currentCollection))); | ||||
|         } | ||||
|         return $currentCollection; | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user