Parcourir la source

update city function incase needed

ifah
Siti Hajar Ibrahim il y a 5 ans
Parent
révision
f08d36f581
2 fichiers modifiés avec 12 ajouts et 16 suppressions
  1. 11
    15
      app/Http/Controllers/Controller.php
  2. 1
    1
      routes/web.php

+ 11
- 15
app/Http/Controllers/Controller.php Voir le fichier

@@ -2,8 +2,7 @@

namespace App\Http\Controllers;

use App\Model\Form;
use App\Model\WorkOrder;
use App\Model\Subscriber;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
@@ -13,22 +12,19 @@ class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;

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

$result = array();
$untaggedform = Form::where('customer_category', null)->get();

foreach ($untaggedform as $key => $a) {
$work_order = WorkOrder::where('_id', $a->_id)->first();
if(!empty($work_order)){
array_push($result, array(
'wo' => $work_order->wo,
));
}
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();
}

return $result;
return "Done standardize city in DB";
}
}

+ 1
- 1
routes/web.php Voir le fichier

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

Route::get('/get-untagged-wo', 'Controller@getUntaggedWorkOrder');
Route::get('/update-city', 'Controller@updateCity');

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

Chargement…
Annuler
Enregistrer