diff --git a/app/Http/Controllers/Site/ReportController.php b/app/Http/Controllers/Site/ReportController.php index 44ccd50..fbfd3d9 100644 --- a/app/Http/Controllers/Site/ReportController.php +++ b/app/Http/Controllers/Site/ReportController.php @@ -129,7 +129,16 @@ class ReportController extends Controller if($this->Config('goldir_price') == 'true'){ $goldir_price = 0; try{ - $goldir = Http::withToken(Cnt::where('key', 'goldir')->first()['value']) + $goldir = Http::withOptions([ + 'curl' => [ + // اجبار به استفاده از IPv4 و جلوگیری از تاخیر IPv6 + CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4, + // افزایش سرعت برقراری ارتباط TCP + CURLOPT_TCP_FASTOPEN => 1, + ] + ]) + ->withoutVerifying() // غیرفعال کردن بررسی SSL (برای تست سرعت) + ->withToken(Cnt::where('key', 'goldir')->first()['value']) ->get('https://gold.ir/server/customer/product/list')->json(); if((isset($goldir['message']) && $goldir['message'] == 'no authorised') || $goldir == null){ $cnt = new Cnt(); @@ -175,7 +184,7 @@ class ReportController extends Controller // } catch (\Exception $e) {$tala_ir = 0;} $main_product_id = Cnt::where('key', 'main_product')->first()['value']; - $refpricer = new ProductController(); +// $refpricer = new ProductController(); // if ($refpricer->getPrice()) { // $ref = true; // } else { @@ -188,7 +197,7 @@ class ReportController extends Controller // $tgn = (int)$taban_gohar['c']*10; // }catch (\Exception $e){$tgn = 0;} - if($this->Config('goldir_price') == 'true') { + if($this->Config('goldir_price') == 'true' && $goldir_price !== 0) { $priceValue = (int)$goldir_price; }else{ $priceValue = /*$tgn !== 0 ? $tgn : */$pr_product['price'] + $pr_product['price_profit'];//$tala_ir;//4000