diff --git a/addons/default/visiosoft/location-module/src/Http/Controller/AjaxController.php b/addons/default/visiosoft/location-module/src/Http/Controller/AjaxController.php index 0d804293c..99bcc22a7 100644 --- a/addons/default/visiosoft/location-module/src/Http/Controller/AjaxController.php +++ b/addons/default/visiosoft/location-module/src/Http/Controller/AjaxController.php @@ -51,6 +51,12 @@ class AjaxController extends PublicController $id = explode(',', $this->request->id); $query = $this->cityRepository->getModel()->whereIn('parent_country_id', $id); + if ($this->request->search) { + $query->where('name', 'like', '%' . $this->request->search . '%'); + } + + $query->get(); + return $this->queryOrder($query, $this->cityRepository); } } @@ -154,4 +160,4 @@ class AjaxController extends PublicController } } -} \ No newline at end of file +}