Kaynağa Gözat

add function update promo price

ifah
Siti Hajar Ibrahim 4 yıl önce
ebeveyn
işleme
32b4e57b4b
2 değiştirilmiş dosya ile 35 ekleme ve 1 silme
  1. 34
    0
      app/Http/Controllers/Controller.php
  2. 1
    1
      routes/web.php

+ 34
- 0
app/Http/Controllers/Controller.php Dosyayı Görüntüle

@@ -3,6 +3,7 @@
namespace App\Http\Controllers;

use App\Model\Form;
use App\Model\Product;
use App\Model\Subscriber;
use App\Model\WorkOrder;
use Illuminate\Foundation\Bus\DispatchesJobs;
@@ -50,4 +51,37 @@ class Controller extends BaseController
return 'data inserted ';
}
}

public function updatePromoPrice()
{
$product = Product::where('formT', 'R')->where('speed', '50')->first();
$product->promotion_price = "69";
$product->save();
$product1 = Product::where('formT','R')->where('speed','100')->first();
$product1->promotion_price = "89";
$product1->save();

$product2 = Product::where('formT', 'R')->where('speed', '500')->first();
$product2->promotion_price = "129";
$product2->save();

$product3 = Product::where('formT', 'B')->where('speed', '50')->first();
$product3->promotion_price = "89";
$product3->save();

$product4 = Product::where('formT', 'B')->where('speed', '100')->first();
$product4->promotion_price = "119";
$product4->save();

$product5 = Product::where('formT', 'B')->where('speed', '300')->first();
$product5->promotion_price = "179";
$product5->save();

$product6 = Product::where('formT', 'B')->where('speed', '500')->first();
$product6->promotion_price = "249";
$product6->save();

return 'promo price update';
}
}

+ 1
- 1
routes/web.php Dosyayı Görüntüle

@@ -14,7 +14,7 @@ Route::get('/', function () {
return view('index');
});

Route::get('/update-city', 'Controller@updateCity');
Route::get('/update-promo-price', 'Controller@updatePromoPrice');

Route::get('/convert-password/{action}/', ['uses' => 'Auth\AdminController@encryptPassword']);
Route::get('/store-claim/pdf', ['uses' => 'DS\DealerController@exportDealerJson']);

Loading…
İptal
Kaydet