fix register 4
This commit is contained in:
@@ -75,6 +75,12 @@ class ReportController extends Controller
|
|||||||
|
|
||||||
public function upDownPrice()
|
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();
|
$upSetting = Setting::where('key', 'up_price')->first();
|
||||||
$downSetting = Setting::where('key', 'down_price')->first();
|
$downSetting = Setting::where('key', 'down_price')->first();
|
||||||
|
|
||||||
@@ -88,12 +94,14 @@ class ReportController extends Controller
|
|||||||
$up = (float) $upSetting->value;
|
$up = (float) $upSetting->value;
|
||||||
|
|
||||||
if ($down > 0 && $up > 0) {
|
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");
|
$today = Carbon::now()->format("Y-m-d");
|
||||||
$prises = Price::where('date_at', $today)->get("price");
|
$prises = Price::where('date_at', $today)->get("price");
|
||||||
|
|
||||||
@@ -113,10 +121,10 @@ class ReportController extends Controller
|
|||||||
$price = Price::orderBy('id', 'desc')->first();
|
$price = Price::orderBy('id', 'desc')->first();
|
||||||
$priceValue = $price->price;
|
$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()
|
public function lastPrice()
|
||||||
|
|||||||
Reference in New Issue
Block a user