Files
car_info_uat/app/model/Vehicle.php
T
2025-04-30 10:53:02 +08:00

46 lines
825 B
PHP

<?php
namespace app\model;
use support\Model;
class Vehicle extends Model
{
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'vehicles';
/**
* The primary key associated with the table.
*
* @var string
*/
protected $primaryKey = 'id';
/**
* Indicates if the model should be timestamped.
*
* @var bool
*/
public $timestamps = false;
/**
* Get the location that owns the vehicle.
*/
public function location()
{
return $this->belongsTo(Location::class, 'locations_id', 'id');
}
/**
* Get the location that owns the vehicle.
*/
public function finalLocation()
{
return $this->belongsTo(Location::class, 'final_locations_id', 'id');
}
}