mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
#4751 [coupon-module] Improve UX
This commit is contained in:
parent
7595c0e6ce
commit
5fe010e83f
@ -129,4 +129,15 @@ class CategoryModel extends CatsCategoryEntryModel implements CategoryInterface
|
||||
{
|
||||
return $this->where('parent_category_id', $this->getId())->get();
|
||||
}
|
||||
|
||||
public function scopeWithTrans($query)
|
||||
{
|
||||
return $query
|
||||
->leftJoin('cats_category_translations as cats_trans', function ($join) {
|
||||
$join->on('cats_category.id', '=', 'cats_trans.entry_id');
|
||||
$join->whereIn(
|
||||
'locale', [config('app.locale'), setting_value('streams::default_locale'), 'en']
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,4 +19,6 @@ interface CategoryInterface extends EntryInterface
|
||||
public function setCategoryIconUrl($url);
|
||||
|
||||
public function getSubCategories();
|
||||
|
||||
public function scopeWithTrans($query);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user