mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
commit
f33a009b58
@ -142,7 +142,7 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
|
||||
$query = $this::withTrashed();
|
||||
}
|
||||
|
||||
if ($id != null) {
|
||||
if ($id !== null) {
|
||||
if ($nullable_ad) {
|
||||
return $query->find($id);
|
||||
} else {
|
||||
@ -158,6 +158,10 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
|
||||
|
||||
public function userAdv($nullable_ad = false, $checkRole = true)
|
||||
{
|
||||
if ($user = Auth::user() and $user->hasRole('admin') && $checkRole) {
|
||||
return $this->getAdv(null, $nullable_ad);
|
||||
}
|
||||
|
||||
return $this->getAdv(null, $nullable_ad)
|
||||
->where('advs_advs.created_by_id', Auth::id());
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -22,4 +22,8 @@ class CategoryCriteria extends EntryCriteria
|
||||
public function getMainCategories() {
|
||||
return $this->categoryRepository->getMainCategories();
|
||||
}
|
||||
|
||||
public function getMainAndSubCats() {
|
||||
return $this->categoryRepository->getMainAndSubCats();
|
||||
}
|
||||
}
|
||||
|
||||
@ -153,10 +153,12 @@ class CategoryRepository extends EntryRepository implements CategoryRepositoryIn
|
||||
'c1.slug',
|
||||
'c1.parent_category_id',
|
||||
'c1.icon',
|
||||
'c1.count',
|
||||
't1.name',
|
||||
'c2.id as c2_id',
|
||||
'c2.slug as c2_slug',
|
||||
'c2.icon as c2_icon',
|
||||
'c2.count as c2_count',
|
||||
'c2.parent_category_id as c2_parent_category_id',
|
||||
't2.name as c2_name'
|
||||
)
|
||||
|
||||
@ -0,0 +1,3 @@
|
||||
<a href="{{ url_route('profile::ads') }}" class="d-block text-decoration-none fs-14 text-dark color-5 py-2 hover-2 px-2 rounded font-weight-bold">
|
||||
{{ trans('visiosoft.module.advs::field.my_ads.name') }}
|
||||
</a>
|
||||
Loading…
Reference in New Issue
Block a user