fix register 4

This commit is contained in:
2026-06-01 18:52:59 +03:30
parent 0a50125ee9
commit cf466c616c
+12 -4
View File
@@ -75,6 +75,12 @@ class ReportController extends Controller
public function upDownPrice()
{
$feeSettings = Setting::whereIn('key', ['fee_single', 'buy_fee', 'sell_fee'])
->pluck('value', 'key');
$difference = (float) ($feeSettings->get('fee_single') ?? 0);
$diffBuy = (float) ($feeSettings->get('buy_fee') ?: $difference);
$diffSell = (float) ($feeSettings->get('sell_fee') ?: $difference);
$upSetting = Setting::where('key', 'up_price')->first();
$downSetting = Setting::where('key', 'down_price')->first();
@@ -88,12 +94,14 @@ class ReportController extends Controller
$up = (float) $upSetting->value;
if ($down > 0 && $up > 0) {
return ['sell' => $down, 'buy' => $up];
return [
'sell' => $down - $diffSell,
'buy' => $up + $diffBuy,
];
}
}
}
$difference = Setting::where('key', 'fee_single')->first()->value;
$today = Carbon::now()->format("Y-m-d");
$prises = Price::where('date_at', $today)->get("price");
@@ -113,10 +121,10 @@ class ReportController extends Controller
$price = Price::orderBy('id', 'desc')->first();
$priceValue = $price->price;
return ['sell' => $priceValue - $difference, 'buy' => $priceValue + $difference];
return ['sell' => $priceValue - $diffSell, 'buy' => $priceValue + $diffBuy];
}
return ['sell' => $minP - $difference, 'buy' => $maxP + $difference];
return ['sell' => $minP - $diffSell, 'buy' => $maxP + $diffBuy];
}
public function lastPrice()