merge goldali with abshode_khanegi branch
This commit is contained in:
+2
-62
@@ -16,41 +16,9 @@ use App\Models\Message;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
Route::get('/refPricer', function () {
|
||||
// $RPrices = Http::get('https://pricing.liman.gold/pricingApi', [])->json();
|
||||
$RPrices = Http::get('http://109.122.246.48:4949/api/free', [])->json();
|
||||
$ok = app(\App\Services\EtehadiePriceService::class)->syncProductsFromApi();
|
||||
|
||||
$products = Product::with([])->whereNotNull('reading_method')->get();
|
||||
foreach ($products as $product) {
|
||||
$collection = collect($RPrices);
|
||||
$RPrice = $collection->firstWhere('key', $product->reading_method);
|
||||
if (!empty($RPrice)) {
|
||||
// foreach ($RPrices as $RPrice) {
|
||||
if ($RPrice['name'] == 'TGJU فلز مس') {
|
||||
$copper = $RPrice['price'] + $RPrice['profit'];
|
||||
}
|
||||
if ($RPrice['name'] == 'TGJU دلار') {
|
||||
$dollar = $RPrice['price'] + $RPrice['profit'];
|
||||
}
|
||||
if ($RPrice['name'] == 'گلد دات ای از آبشده - رسمی - نقد فردا') {
|
||||
$RPrice['price'] = $RPrice['price'] / 4.3318;
|
||||
}
|
||||
ProductPriceService::syncFromReference(
|
||||
$product,
|
||||
(int) $RPrice['price'],
|
||||
(int) ($RPrice['profit'] ?? 0)
|
||||
);
|
||||
// }
|
||||
}
|
||||
}
|
||||
if (isset($copper) && isset($dollar)) {
|
||||
$cp = ($copper / 1000000) * $dollar;
|
||||
$copperProduct = Product::find(33);
|
||||
if ($copperProduct) {
|
||||
ProductPriceService::syncFromReference($copperProduct, (int) round($cp), 0);
|
||||
}
|
||||
}
|
||||
|
||||
return response()->json(true);
|
||||
return response()->json($ok);
|
||||
});
|
||||
|
||||
Route::get('/1', function () {
|
||||
@@ -281,19 +249,6 @@ Route::get('/getJibitCounter', function (Request $request) {
|
||||
// });
|
||||
// return $subs;
|
||||
//});
|
||||
//Route::get('testliman', function () {
|
||||
// $payload = [
|
||||
// 'amount' => "0.02",
|
||||
// 'description' =>$this->ConfigService('name_fa')." - "."سس ",
|
||||
// 'ref_id' => 000,
|
||||
// 'direction' => 1,
|
||||
// 'product_id' => 2
|
||||
// ];
|
||||
//
|
||||
// return $response = Http::withToken($this->ConfigService('liman_token'))
|
||||
// ->post("https://limangold.ir/kernel/customer/order",$payload)->json();
|
||||
//
|
||||
//});
|
||||
//Route::get('/gDom', function () {
|
||||
//
|
||||
// return strtr($_SERVER['SERVER_NAME'], '.', '_');
|
||||
@@ -312,21 +267,6 @@ Route::get('/getJibitCounter', function (Request $request) {
|
||||
// $customer->save(); // Save the updated sum_gold into the database
|
||||
// });
|
||||
//});
|
||||
//Route::get('/SENDtrAORDOR', function () {
|
||||
// $payload = [
|
||||
// 'amount' => "1",
|
||||
// 'direction' => 1,
|
||||
// 'product_id' => 2
|
||||
// ];
|
||||
// $response = Http::withToken("eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvbGltYW5nb2xkLmlyXC9rZXJuZWxcL2F1dGhcL2xvZ2luIiwiaWF0IjoxNzI3NjI3NTc1LCJleHAiOjE3MzAyMTk1NzUsIm5iZiI6MTcyNzYyNzU3NSwianRpIjoiZTNTUk1kcEdmSTh3clZwUCIsInN1YiI6MjMsInBydiI6IjFkMGEwMjBhY2Y1YzRiNmM0OTc5ODlkZjFhYmYwZmJkNGU4YzhkNjMifQ.5miGMG7jo1ISRjV_4hXiCceubc5IJ-qe_nq9zUj7-7Y")
|
||||
// ->post("https://limangold.ir/kernel/customer/order",$payload)->json();
|
||||
// return $response;
|
||||
//});
|
||||
//Route::get('/SENDtrAORDOR2', function () {
|
||||
// $response = Http::withToken("eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvbGltYW5nb2xkLmlyXC9rZXJuZWxcL2F1dGhcL2xvZ2luIiwiaWF0IjoxNzI3NjI3NTc1LCJleHAiOjE3MzAyMTk1NzUsIm5iZiI6MTcyNzYyNzU3NSwianRpIjoiZTNTUk1kcEdmSTh3clZwUCIsInN1YiI6MjMsInBydiI6IjFkMGEwMjBhY2Y1YzRiNmM0OTc5ODlkZjFhYmYwZmJkNGU4YzhkNjMifQ.5miGMG7jo1ISRjV_4hXiCceubc5IJ-qe_nq9zUj7-7Y")
|
||||
// ->get("https://limangold.ir/kernel/customer/product/list")->json();
|
||||
// return $response;
|
||||
//});
|
||||
//Route::get('/TEST', function () {
|
||||
// $url = 'https://zify.ir/api/order/v2/create';
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user