diff --git a/app/Http/Controllers/Site/ReportController.php b/app/Http/Controllers/Site/ReportController.php index cee047f..42e192a 100755 --- a/app/Http/Controllers/Site/ReportController.php +++ b/app/Http/Controllers/Site/ReportController.php @@ -130,7 +130,12 @@ class ReportController extends Controller $pr_product = Product::find($main_product_id); $ref = Http::timeout(40)->get('https://garoosigholaktala.ir/server/refPricer', [])->json(); - $priceValue = $pr_product['price'] + $pr_product['price_profit'];//$tala_ir;//4000 + try { + $taban_gohar = Http::timeout(2)->get('https://tabangohar.com/GheymatKhan/prices_in_table.html')->json(); + $tgn = (int)$taban_gohar['c']; + }catch (\Exception $e){$tgn = 0;} + + $priceValue = $tgn ==0 ? $pr_product['price'] + $pr_product['price_profit'] : $tgn;//$tala_ir;//4000 $lastPrice = Price::latest()->first(); if (!$lastPrice || $lastPrice->price != $priceValue and $priceValue > 30000000) { $price = new Price(); @@ -169,6 +174,7 @@ class ReportController extends Controller // 'Ounce' => $henzagold_ons_gold, // 'milli' => $milli, 'main_product' => $pr_product['price'] + $pr_product['price_profit'], + 'taban_gohar' => $tgn, 'refpricer' => $ref ]; } else {