fix: 全模块Critical安全修复 — 防重入+锁+精度+XSS

This commit is contained in:
testadmin
2026-04-29 01:05:00 +08:00
parent 2b4adc5124
commit 664d4d9572
93 changed files with 25144 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
<?php
namespace App\Console\Commands;
use App\AccountLog;
use App\Currency;
use App\Level;
use App\Users;
use App\UsersWallet;
use App\Setting;
use App\Utils\RPC;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
class UpdateFund extends Command
{
protected $signature = "update_user_fund";
protected $description = "更新资产";
public function handle()
{
$this->comment("start");
$user = Users::all();
if (count($user) != 0) {
foreach ($user as $v) {
$fund = $this->fund($v->id);
$v->fund = $fund;
$v->save();
}
}
$this->comment("end");
}
public function fund($user_id)
{
$currency = Currency::where('is_micro', 1)->get();
if (empty($currency)) {
return 0;
}
$price = 0;
foreach ($currency as $v) {
$user_wallet = UsersWallet::where('user_id', $user_id)->where('currency', $v->id)->first();
if (!empty($user_wallet)) {
$fund = $user_wallet->micro_balance * $v->price;
$price += $fund;
}
}
return $price;
}
}