new check for kashkol

This commit is contained in:
2026-06-12 16:06:37 +03:30
parent 80bcfbf5cf
commit e3bc50e2c6
6 changed files with 46 additions and 54 deletions
+3 -33
View File
@@ -138,7 +138,6 @@ class ReportController extends Controller
$montzar_price = 0;
$zaarbox_price = 0;
$tgn = 0;
$pr_price = 0;
$open_buy = true;
@@ -207,7 +206,6 @@ class ReportController extends Controller
*/
$settings = Setting::whereIn('key', [
'fee_single',
'tabanGohar_price',
'main_product_price',
'buy_fee',
'sell_fee',
@@ -215,7 +213,6 @@ class ReportController extends Controller
$settingsMap = $settings->pluck('value', 'key');
$show_last_price = $config->getBool('show_last_price', false);
$taban_gohar_price = $settingsMap->get('tabanGohar_price');
$main_product_price = $settingsMap->get('main_product_price');
$difference = (float) $settingsMap->get('fee_single', 0);
@@ -341,30 +338,6 @@ class ReportController extends Controller
}
}
/*
|--------------------------------------------------------------------------
| Taban Gohar
|--------------------------------------------------------------------------
*/
if ($toBool($taban_gohar_price) && !$closed) {
try {
$taban_gohar = Http::withOptions([
'curl' => [
CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4,
CURLOPT_TCP_FASTOPEN => 1,
],
])
->withoutVerifying()
->timeout(2)
->get('https://tabangohar.com/GheymatKhan/prices_in_table.html')
->json();
$tgn = (int) $taban_gohar['c'] * 10;
} catch (\Throwable $e) {
$tgn = 0;
}
}
/*
|--------------------------------------------------------------------------
| انتخاب قیمت اصلی (همان price_provider)
@@ -376,9 +349,6 @@ class ReportController extends Controller
} elseif ($priceProvider === 'montzar' && ($montzar_price ?? 0) !== 0 && !$closed) {
$priceValue = (int) $montzar_price;
$priceSource = 'montzar';
} elseif ($priceProvider === 'taban_gohar' && $toBool($taban_gohar_price) && ($tgn ?? 0) !== 0 && !$closed) {
$priceValue = $tgn;
$priceSource = 'taban_gohar';
} elseif ($priceProvider === 'main_product' && ($pr_price ?? 0) !== 0 && !$closed) {
$priceValue = $pr_price;
$priceSource = 'main_product';
@@ -395,7 +365,7 @@ class ReportController extends Controller
'price_last' => 0,
'price' => 0,
'main_product' => $pr_price ?? 0,
'taban_gohar' => $tgn ?? 0,
'taban_gohar' => 0,
'montzar' => $montzar_price ?? 0,
'zaarbox' => $zaarbox_price ?? 0,
'closed' => true,
@@ -413,7 +383,7 @@ class ReportController extends Controller
'price_last' => 0,
'price' => 0,
'main_product' => $pr_price ?? 0,
'taban_gohar' => $tgn ?? 0,
'taban_gohar' => 0,
'montzar' => $montzar_price ?? 0,
'zaarbox' => $zaarbox_price ?? 0,
'closed' => true,
@@ -525,7 +495,7 @@ class ReportController extends Controller
'price_last' => $priceLast,
'price' => $priceValue,
'main_product' => $pr_price ?? 0,
'taban_gohar' => $tgn ?? 0,
'taban_gohar' => 0,
'montzar' => $montzar_price ?? 0,
'zaarbox' => $zaarbox_price ?? 0,
'closed' => false,