Merge pull request #1150 from openclassify/muammertop

location search and category icon
This commit is contained in:
profstyle1 2021-08-26 17:49:06 +03:00 committed by GitHub
commit 91884fecc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 1 deletions

View File

@ -5,6 +5,20 @@ use Anomaly\Streams\Platform\Model\Cats\CatsCategoryEntryModel;
class CategoryModel extends CatsCategoryEntryModel implements CategoryInterface class CategoryModel extends CatsCategoryEntryModel implements CategoryInterface
{ {
protected $appends = [
'icon_url',
];
public function getIconUrlAttribute()
{
if ($this->icon === null) {
return $this->dispatch(new MakeImageInstance('visiosoft.module.advs::images/listing/sample-cat-icon.svg', 'img'))->url();
}
return url($this->icon);
}
public function getCat($id) public function getCat($id)
{ {
return CategoryModel::query() return CategoryModel::query()

View File

@ -51,6 +51,10 @@ class AjaxController extends PublicController
$id = explode(',', $this->request->id); $id = explode(',', $this->request->id);
$query = $this->cityRepository->getModel()->whereIn('parent_country_id', $id); $query = $this->cityRepository->getModel()->whereIn('parent_country_id', $id);
if ($this->request->search) {
$query->where('name', 'like', '%' . $this->request->search . '%');
}
return $this->queryOrder($query, $this->cityRepository); return $this->queryOrder($query, $this->cityRepository);
} }
} }
@ -154,4 +158,4 @@ class AjaxController extends PublicController
} }
} }
} }