43 lines
860 B
PHP
43 lines
860 B
PHP
<?php
|
|
|
|
namespace App\Helpers;
|
|
use App\Models\ClientModel;
|
|
use App\Models\VehicleModel;
|
|
|
|
class ClientDetailsUpdate
|
|
{
|
|
|
|
|
|
|
|
public static function updateClientAddress($vehicle_id,$address)
|
|
{
|
|
|
|
$ClientModel = new ClientModel();
|
|
$VehicleModel = new VehicleModel();
|
|
|
|
|
|
$client_id = $VehicleModel->where('vehicle_id', $vehicle_id)->get()->getRow()->client_id;
|
|
|
|
$data = [
|
|
'address' => $address['billing_address'],
|
|
'city' => $address['billing_city'],
|
|
'state' => $address['billing_state'],
|
|
'postal_code' => $address['billing_postal_code']
|
|
];
|
|
|
|
$VehicleModel->update($vehicle_id, $data);
|
|
$update = $ClientModel->update($client_id, $data);
|
|
|
|
if($update){
|
|
return true;
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
?>
|