mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
Merge pull request #404 from openclassify/dia
#1039 Adv kategorisi olmayan link seo hatası
This commit is contained in:
commit
05d33ae099
@ -27,4 +27,5 @@ return [
|
||||
'success_delete' => 'Ad Deleted',
|
||||
'pending_ad_status' => 'Your ad is pending approval by the Editor.',
|
||||
'extended' => ':number ad(s) has been extended successfully.',
|
||||
'category_not_exist' => 'This category does not exist anymore!',
|
||||
];
|
||||
|
||||
@ -84,12 +84,15 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
|
||||
if (!empty($param['cat'])) {
|
||||
$cat = new CategoryModel();
|
||||
$cat_d = $cat->find($param['cat']);
|
||||
if ($cat_d->parent_category_id == null)
|
||||
$catLevel = 1;
|
||||
else
|
||||
$catLevel = $cat->getCatLevel($param['cat']);
|
||||
$catLevel = "cat" . $catLevel;
|
||||
$query = $query->where($catLevel, $param['cat']);
|
||||
if ($cat_d) {
|
||||
if ($cat_d->parent_category_id == null) {
|
||||
$catLevel = 1;
|
||||
} else {
|
||||
$catLevel = $cat->getCatLevel($param['cat']);
|
||||
}
|
||||
$catLevel = "cat" . $catLevel;
|
||||
$query = $query->where($catLevel, $param['cat']);
|
||||
}
|
||||
}
|
||||
if (!empty($param['user'])) {
|
||||
$query = $query->where('advs_advs.created_by_id', $param['user']);
|
||||
|
||||
@ -158,11 +158,16 @@ class AdvsController extends PublicController
|
||||
}
|
||||
} elseif (isset($param['cat']) && !empty($param['cat'])) {
|
||||
$categoryId = $this->category_repository->find($param['cat']);
|
||||
return redirect($this->fullLink(
|
||||
$param,
|
||||
route('adv_list_seo', [$categoryId->slug]),
|
||||
array()
|
||||
));
|
||||
if ($categoryId) {
|
||||
return redirect($this->fullLink(
|
||||
$param,
|
||||
route('adv_list_seo', [$categoryId->slug]),
|
||||
array()
|
||||
));
|
||||
} else {
|
||||
$this->messages->error(trans('visiosoft.module.advs::message.category_not_exist'));
|
||||
return redirect('/');
|
||||
}
|
||||
}
|
||||
|
||||
// Search by city slug
|
||||
|
||||
Loading…
Reference in New Issue
Block a user