⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.94
Server IP:
178.33.27.10
Server:
Linux cpanel.dev-unit.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
Server Software:
Apache/2.4.57 (Unix) OpenSSL/1.0.2k-fips
PHP Version:
8.2.11
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
id
/
hrms.dev-unit.com
/
app
/
Models
/
View File Name :
Plan.php
<?php namespace App\Models; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Facades\DB; class Plan extends Model { protected $fillable = [ 'name', 'price', 'duration', 'max_users', 'max_employees', 'max_venders', 'storage_limit', 'enable_chatgpt', 'trial', 'trial_days', 'description', 'image', ]; public static $arrDuration = [ '' => 'Select Duration', 'Lifetime' => 'Lifetime', 'month' => 'Per Month', 'year' => 'Per Year', ]; public function status() { return [ __('Lifetime'), __('Per Month'), __('Per Year'), ]; } public static function total_plan() { return Plan::count(); } public static function most_purchese_plan() { $free_plan = Plan::where('price', '<=', 0)->first()->id; return User:: select('plans.name','plans.id', DB::raw('count(*) as total')) ->join('plans', 'plans.id' ,'=', 'users.plan') ->where('type', '=', 'company') ->where('plan', '!=', $free_plan) ->orderBy('total','Desc') ->groupBy('plans.name','plans.id') ->first(); } }