Merge pull request #1137 from openclassify/muammertop

Muammertop
This commit is contained in:
Dia Shalabi 2021-08-11 15:37:04 +03:00 committed by GitHub
commit f33a009b58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 3 deletions

View File

@ -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

View File

@ -22,4 +22,8 @@ class CategoryCriteria extends EntryCriteria
public function getMainCategories() {
return $this->categoryRepository->getMainCategories();
}
public function getMainAndSubCats() {
return $this->categoryRepository->getMainAndSubCats();
}
}

View File

@ -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'
)
@ -182,4 +184,4 @@ class CategoryRepository extends EntryRepository implements CategoryRepositoryIn
$cats->maincats = $catsDB->unique('id');
return $cats;
}
}
}

View File

@ -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>