Naser remove refpricer from last api

This commit is contained in:
gholak tala
2026-02-16 12:16:11 +00:00
parent 1250f18c88
commit 95be6961fa
3 changed files with 20 additions and 12 deletions
-3
View File
@@ -15,13 +15,10 @@ use App\Http\Controllers\Customer\PriceTriggerController;
use App\Http\Controllers\Finance\FinanceController;
use App\Http\Controllers\Admin\ProductController;
use App\Http\Controllers\Admin\TahesabController;
<<<<<<< HEAD
use App\Http\Controllers\Admin\FileController;
use App\Http\Controllers\Site\OfferCodesController;
=======
use App\Http\Controllers\Admin\SettingsController;
>>>>>>> a0a788ce53f1b3dff84bd16f3b7db585071bc159
Route::middleware('auth:user')->group(function (){
Route::middleware('validation')->group(function (){
+13 -2
View File
@@ -13,11 +13,22 @@ use Ramsey\Uuid\Uuid;
use App\Http\Controllers\pay\PaymanController;
Route::get('/refPricer', function () {
$RPrices =Http::timeout(40)->get('http://212.23.201.173:8381/price_list', [])->json();
$RPrices = Http::get('https://pricing.liman.gold/pricingApi', [])->json();
try{
$cooper =Http::timeout(40)->get('https://www.livedata.ir/main/static/p.json', [])->json();
if(isset($cooper['s_301006']) && isset($cooper['s_200103'])){
$CP = (($cooper['s_301006']/1000000)*$cooper['s_200103'])*10;
// Cnt::where('key', 'cu_price')
}
}catch (\Exception $e){}
$products = Product::with([])->whereNotNull('reading_method')->get();
foreach ($products as $product) {
foreach ($RPrices as $RPrice) {
if($product->reading_method == 'مس' && $CP){
$p = Product::where('id', $product->id)->update([
'price' => $CP,
]);
}
if ($product->reading_method == $RPrice['name']) {
$p = Product::where('id', $product->id)->update([
'price' => $RPrice['price'],