Merge pull request #1212 from openclassify/dia

#4751 [coupon-module] Improve UX
This commit is contained in:
Muammer Top 2021-10-26 17:12:53 +03:00 committed by GitHub
commit 93b8667b37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 1 deletions

View File

@ -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']
);
});
}
}

View File

@ -19,4 +19,6 @@ interface CategoryInterface extends EntryInterface
public function setCategoryIconUrl($url);
public function getSubCategories();
public function scopeWithTrans($query);
}

View File

@ -12,7 +12,7 @@ class CacheController extends PublicController
$profile_img = $user ? $this->dispatch(
new MakeImageInstance($user->file ?: 'theme::images/no_profile.svg', 'img')
)->url() : $user;
$user = $user ? $user->first_name . ' ' . $user->last_name : $user;
$user = $user ? $user->name() : $user;
$getAddBlockHtml = new addBlock('navigation/dropdown', []);
$addBlockHtml = $getAddBlockHtml->handle();