faq updated
This commit is contained in:
@@ -198,6 +198,7 @@ class ManageFaqController extends Controller
|
||||
$tags = $this->tagWithFaqs()->getData();
|
||||
// $tagName = Tag::has('faq')->orderBy('tag_name','ASC')->get(['id', 'tag_name']);
|
||||
$tagName = Tag::has('faq')->orderBy(\DB::raw('(id = 49) DESC, tag_name, id'))->get(['id', 'tag_name']);
|
||||
// dd($tags,$tagName);
|
||||
return view('Frontend.Pages.resources.faqs', ['tags' => $tags->data, 'tagName' => $tagName]);
|
||||
}
|
||||
|
||||
@@ -218,12 +219,13 @@ class ManageFaqController extends Controller
|
||||
|
||||
public function getAllTagsRelatedToFaq()
|
||||
{
|
||||
$tags = Tag::query()
|
||||
->join('faq', 'tags.id', 'faq.tag_id')
|
||||
->where('is_active', true)
|
||||
->select('tags.id', 'tag_name')
|
||||
->distinct('id', 'tag_name')
|
||||
->get();
|
||||
// $tags = Tag::query()
|
||||
// ->join('faq', 'tags.id', 'faq.tag_id')
|
||||
// ->where('is_active', true)
|
||||
// ->select('tags.id', 'tag_name')
|
||||
// ->distinct('id', 'tag_name')
|
||||
// ->get();
|
||||
$tags = Tag::has('faq')->orderBy(\DB::raw('(id = 49) DESC, tag_name, id'))->get(['id', 'tag_name']);
|
||||
if ($tags) {
|
||||
return response()->json([
|
||||
"status" => "success",
|
||||
|
||||
Reference in New Issue
Block a user