NASER fix some issue
This commit is contained in:
@@ -129,7 +129,16 @@ class ReportController extends Controller
|
|||||||
if($this->Config('goldir_price') == 'true'){
|
if($this->Config('goldir_price') == 'true'){
|
||||||
$goldir_price = 0;
|
$goldir_price = 0;
|
||||||
try{
|
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();
|
->get('https://gold.ir/server/customer/product/list')->json();
|
||||||
if((isset($goldir['message']) && $goldir['message'] == 'no authorised') || $goldir == null){
|
if((isset($goldir['message']) && $goldir['message'] == 'no authorised') || $goldir == null){
|
||||||
$cnt = new Cnt();
|
$cnt = new Cnt();
|
||||||
@@ -175,7 +184,7 @@ class ReportController extends Controller
|
|||||||
// } catch (\Exception $e) {$tala_ir = 0;}
|
// } catch (\Exception $e) {$tala_ir = 0;}
|
||||||
|
|
||||||
$main_product_id = Cnt::where('key', 'main_product')->first()['value'];
|
$main_product_id = Cnt::where('key', 'main_product')->first()['value'];
|
||||||
$refpricer = new ProductController();
|
// $refpricer = new ProductController();
|
||||||
// if ($refpricer->getPrice()) {
|
// if ($refpricer->getPrice()) {
|
||||||
// $ref = true;
|
// $ref = true;
|
||||||
// } else {
|
// } else {
|
||||||
@@ -188,7 +197,7 @@ class ReportController extends Controller
|
|||||||
// $tgn = (int)$taban_gohar['c']*10;
|
// $tgn = (int)$taban_gohar['c']*10;
|
||||||
// }catch (\Exception $e){$tgn = 0;}
|
// }catch (\Exception $e){$tgn = 0;}
|
||||||
|
|
||||||
if($this->Config('goldir_price') == 'true') {
|
if($this->Config('goldir_price') == 'true' && $goldir_price !== 0) {
|
||||||
$priceValue = (int)$goldir_price;
|
$priceValue = (int)$goldir_price;
|
||||||
}else{
|
}else{
|
||||||
$priceValue = /*$tgn !== 0 ? $tgn : */$pr_product['price'] + $pr_product['price_profit'];//$tala_ir;//4000
|
$priceValue = /*$tgn !== 0 ? $tgn : */$pr_product['price'] + $pr_product['price_profit'];//$tala_ir;//4000
|
||||||
|
|||||||
Reference in New Issue
Block a user