mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-18 07:38:29 +00:00
Various bug fixes.
This commit is contained in:
@@ -21,20 +21,30 @@ class SearchController extends BaseController
|
||||
public function index()
|
||||
{
|
||||
$subTitle = null;
|
||||
$rawQuery = null;
|
||||
$result = [];
|
||||
if (!is_null(Input::get('q'))) {
|
||||
$rawQuery = trim(Input::get('q'));
|
||||
$words = explode(' ', $rawQuery);
|
||||
$subTitle = 'Results for "' . e($rawQuery) . '"';
|
||||
|
||||
/*
|
||||
* Search for transactions:
|
||||
*/
|
||||
$result = $this->_helper->transactions($words);
|
||||
$transactions = $this->_helper->searchTransactions($words);
|
||||
$accounts = $this->_helper->searchAccounts($words);
|
||||
$categories = $this->_helper->searchCategories($words);
|
||||
$budgets = $this->_helper->searchBudgets($words);
|
||||
$tags = $this->_helper->searchTags($words);
|
||||
$result = [
|
||||
'transactions' => $transactions,
|
||||
'accounts' => $accounts,
|
||||
'categories' => $categories,
|
||||
'budgets' => $budgets,
|
||||
'tags' => $tags
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
return View::make('search.index')->with('title', 'Search')->with('subTitle', $subTitle)->with(
|
||||
'mainTitleIcon', 'fa-search'
|
||||
);
|
||||
)->with('query', $rawQuery)->with('result',$result);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user