Skip to content

Commit

Permalink
Merge pull request #145 from sarapis/feedback-changes
Browse files Browse the repository at this point in the history
Fix home category data issue
  • Loading branch information
d9it committed Mar 18, 2024
2 parents 6e84601 + c5cc98e commit 93d99b8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions app/Http/Controllers/HomeController.php
Expand Up @@ -82,12 +82,14 @@ public function home($value = '')
$taxonomy_tree[] = $taxonomy_data;
}
} else {
$serviceCategoryId = TaxonomyType::orderBy('order')->where('type', 'internal')->where('name', 'Service Category')->first();
$parent_taxonomies = Taxonomy::whereNull('taxonomy_parent_name')->where('taxonomy', $serviceCategoryId ? $serviceCategoryId->taxonomy_type_recordid : '');
$serviceCategoryId = TaxonomyType::orderBy('order')->where('name', 'Service Category')->first();
$parent_taxonomies = Taxonomy::whereNull('taxonomy_parent_name')->whereNotNull('taxonomy_name')->where('taxonomy', 'LIKE', '%' . ($serviceCategoryId ? $serviceCategoryId->taxonomy_type_recordid : '') . '%');
$taxonomy_recordids = Taxonomy::getTaxonomyRecordids();
if(count($taxonomy_recordids) > 0){
$parent_taxonomies->whereIn('taxonomy_recordid',array_values($taxonomy_recordids));

if (count($taxonomy_recordids) > 0) {
$parent_taxonomies->whereIn('taxonomy_recordid', array_values($taxonomy_recordids));
}

$taxonomy_tree['parent_taxonomies'] = $parent_taxonomies->get();
}

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/frontEnd/ServiceController.php
Expand Up @@ -333,7 +333,7 @@ public function index()
}
} else {
$serviceCategoryId = TaxonomyType::orderBy('order')->first();
$parent_taxonomies = Taxonomy::whereNull('taxonomy_parent_name');
$parent_taxonomies = Taxonomy::whereNull('taxonomy_parent_name')->whereNotNull('taxonomy_name');
$taxonomy_recordids = Taxonomy::getTaxonomyRecordids();
if (count($taxonomy_recordids) > 0) {
$parent_taxonomies->whereIn('taxonomy_recordid', $taxonomy_recordids);
Expand Down

0 comments on commit 93d99b8

Please sign in to comment.