NASER fix price issues & close trade when tahesab is unavailable
This commit is contained in:
@@ -152,9 +152,9 @@ class ReportController extends Controller
|
||||
$buy = $lp['sub_agent']['rate_buy_gram_price'];
|
||||
$sell = $lp['sub_agent']['rate_sell_gram_price'];
|
||||
|
||||
$customPrice['price'] = ($buy + $sell) / 2;
|
||||
$customPrice['price'] = (ceil($buy) + ceil($sell)) / 2;
|
||||
Cnt::where('key', 'goldir_price')->update(['value' => (float)$customPrice['price']]);//was float
|
||||
$customPrice['diff'] = ($buy - $sell) / 2;
|
||||
$customPrice['diff'] = (ceil($buy) - ceil($sell)) / 2;
|
||||
Cnt::where('key', 'goldir_diff')->update(['value' => (float)$customPrice['diff']]);//was float
|
||||
|
||||
Cnt::where('key', 'goldir_mazaneh')->update(['value' => ((float)$customPrice['price'] * 4.331802)]);
|
||||
@@ -239,10 +239,14 @@ class ReportController extends Controller
|
||||
}
|
||||
$price = Price::orderBy('id', 'desc')->first();
|
||||
if ($price) {
|
||||
if($this->Config('goldir_price') == 'true' && $goldir_price !==0){
|
||||
$goldir_profit = Cnt::where('key', 'goldir_diff')->first()['value'];
|
||||
$difference = $goldir_profit;
|
||||
}
|
||||
return [
|
||||
'sell' => $price->price - $difference,
|
||||
'buy' => $price->price + $difference,
|
||||
'price_last' => $price->price + $difference,
|
||||
'sell' => ceil($price->price - $difference),
|
||||
'buy' => ceil($price->price + $difference),
|
||||
'price_last' => ceil($price->price + $difference),
|
||||
'price' => $priceValue,
|
||||
'main_product' => $pr_product['price'] + $pr_product['price_profit'],
|
||||
'taban_gohar' => $tgn ?? 0,
|
||||
|
||||
Reference in New Issue
Block a user