NASER get price from taban gohar
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user