Bläddra i källkod

add function update address

ifah
Siti Hajar Ibrahim 5 år sedan
förälder
incheckning
91dad1d0b9
2 ändrade filer med 18 tillägg och 8 borttagningar
  1. 17
    7
      app/Http/Controllers/Controller.php
  2. 1
    1
      routes/web.php

+ 17
- 7
app/Http/Controllers/Controller.php Visa fil

@@ -17,17 +17,27 @@ class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;

public function updateCity()
public function updateAddress()
{
$subscribers = Subscriber::all();

foreach ($subscribers as $key => $a) {
$a->unit_no = strtoupper($a->unit_no);
$a->building_name = strtoupper($a->building_name);
$a->street = strtoupper($a->street);
$a->city = strtoupper($a->city);
$a->state = strtoupper($a->state);
$a->save();
if($a->unit_no != '' || $a->unit_no != null){
$a->unit_no = strtoupper($a->unit_no);
}
if ($a->building_name != '' || $a->building_name != null) {
$a->building_name = strtoupper($a->building_name);
}
if ($a->street != '' || $a->street != null) {
$a->street = strtoupper($a->street);
}
if ($a->city != ''|| $a->city != null) {
$a->city = strtoupper($a->city);
}
if ($a->state != ''|| $a->state != null) {
$a->state = strtoupper($a->state);
}
$a->save();
}

return "Done standardize city in DB";

+ 1
- 1
routes/web.php Visa fil

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

Route::get('/update-promo-price', 'Controller@deleteTodayClaim');
Route::get('/update-promo-price', 'Controller@updateAddress');

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

Laddar…
Avbryt
Spara