mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-24 22:11:01 -06:00
#243 Searching with ad ID in Ad search bar
This commit is contained in:
parent
88cca12b5a
commit
6e997e71fa
@ -63,13 +63,17 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (!empty($param['keyword'])) {
|
if (!empty($param['keyword'])) {
|
||||||
$delimiter = '_';
|
if (is_numeric($param['keyword'])) {
|
||||||
$keyword = str_slug($param['keyword'], $delimiter);
|
$query = $query->where('advs_advs.id', $param['keyword']);
|
||||||
$query = $query->where(function ($query) use ($keyword) {
|
} else {
|
||||||
$query->where('advs_advs_translations.advs_desc', 'like', '%' . $keyword . '%')
|
$delimiter = '_';
|
||||||
->orWhere('slug', 'like', '%' . $keyword . '%')
|
$keyword = str_slug($param['keyword'], $delimiter);
|
||||||
->orWhere('advs_advs_translations.name', 'like', '%' . $keyword . '%');
|
$query = $query->where(function ($query) use ($keyword) {
|
||||||
});
|
$query->where('advs_advs_translations.advs_desc', 'like', '%' . $keyword . '%')
|
||||||
|
->orWhere('slug', 'like', '%' . $keyword . '%')
|
||||||
|
->orWhere('advs_advs_translations.name', 'like', '%' . $keyword . '%');
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!empty($param['country'])) {
|
if (!empty($param['country'])) {
|
||||||
$query = $query->where('country_id', $param['country']);
|
$query = $query->where('country_id', $param['country']);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user