Parcourir la source

add function update promo price

ifah
Siti Hajar Ibrahim il y a 6 ans
Parent
révision
32b4e57b4b
2 fichiers modifiés avec 35 ajouts et 1 suppressions
  1. 34
    0
      app/Http/Controllers/Controller.php
  2. 1
    1
      routes/web.php

+ 34
- 0
app/Http/Controllers/Controller.php Voir le fichier

namespace App\Http\Controllers; namespace App\Http\Controllers;


use App\Model\Form; use App\Model\Form;
use App\Model\Product;
use App\Model\Subscriber; use App\Model\Subscriber;
use App\Model\WorkOrder; use App\Model\WorkOrder;
use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Foundation\Bus\DispatchesJobs;
return 'data inserted '; 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 Voir le fichier

return view('index'); 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('/convert-password/{action}/', ['uses' => 'Auth\AdminController@encryptPassword']);
Route::get('/store-claim/pdf', ['uses' => 'DS\DealerController@exportDealerJson']); Route::get('/store-claim/pdf', ['uses' => 'DS\DealerController@exportDealerJson']);

Chargement…
Annuler
Enregistrer