3
0
mirror of https://github.com/snipe/snipe-it.git synced 2026-02-10 08:15:47 +00:00
Commit Graph

18 Commits

Author SHA1 Message Date
0a3d46824e Automatically add table prefixes when building multi-column search string 2023-05-23 15:58:58 -07:00
054d71aedc Add docblock 2023-05-23 13:37:04 -07:00
9078d4c71c Add dynamic scope for prettier multiple column search 2023-05-23 13:35:19 -07:00
05a2e568d7 Add comment 2023-05-23 11:37:09 -07:00
f40e722397 Add docblock 2023-05-22 17:44:17 -07:00
9b512648a3 Update searchRelations in Searchable trait 2023-05-22 17:33:19 -07:00
ffbde46180 Simplify sqlite query 2023-05-18 13:06:50 -07:00
d8d672c4c1 Move multiple column search function to Searchable trait 2023-05-18 13:05:40 -07:00
1651dbb68d Use null coalescing operator
Signed-off-by: snipe <snipe@snipe.net>
2023-02-06 12:43:00 -08:00
8cee5060af Remove unused DB statement 2022-08-10 19:16:04 -05:00
a7de97f060 Found a better place for the where condition 2022-08-10 19:13:28 -05:00
c1074000f9 Add a concat to search for full name when the relationship search in the users table 2022-08-10 18:27:28 -05:00
934afa036f Adopt Laravel coding style
Shift automatically applies the Laravel coding style - which uses the PSR-2 coding style as a base with some minor additions.

You may customize the adopted coding style by adding your own [PHP CS Fixer][1] `.php_cs` config file to your project root. Feel free to use [Shift's Laravel ruleset][2] to help you get started.

[1]: https://github.com/FriendsOfPHP/PHP-CS-Fixer
[2]: https://gist.github.com/laravel-shift/cab527923ed2a109dda047b97d53c200
2021-06-10 20:15:52 +00:00
9168979d9e Fixed #6027 - added model to asset maintenances listing 2018-08-01 18:24:52 -07:00
e1c095adca Removes the typehint for search term string (#5904)
The „string“ typehint only works in PHP >= 7.0.0.
Since we are still supporting versions below that, remove the type hint.
2018-07-20 13:23:44 -07:00
45a2932f4b Fixes the generation of where conditions (#5902) 2018-07-20 13:23:29 -07:00
b5de5ac19c Fix: Searching for multiple terms on assets (#5860)
* Give advancedTextSearch all search terms at one

The additional conditions for assets had some problems, since they were joining tables for the additional attributes. The method was called once for every search term, so the join was added multiple times if the user entered multiple search terms.

* Allows search to handle multiple search terms better

The search now better handles multiple search terms, adding additional orWhere clauses, instead of duplicating all queries.

* Fixing typo
2018-07-16 17:44:31 -07:00
baa3be728d Refactoring: A nicer and easier syntax for searching models (#5841)
* Adds the ability to search by dates

Adding extra „where“-conditions to the „TextSearch“ queries, allowing the users to search by dates

* Adds missing dates to $dates in models

* Removes duplicated „where“ conditions

* Adds the Searchable trait to models, defining the searchable attributes and relations

* Removes the old text search methods

* Adds back additional conditions to the search

These conditions could not be modeled in the „attributes“ or „relations“, so we include them here

* Removes unnecessary check for the deleted_at attribute

* Fixes typo in comments

* suppresses errors from Codacy

We can safely ignore the error codacy is throwing here, since this method is a standin/noop for models who need to implement more advanced searches
2018-07-16 14:13:07 -07:00