停车场管理系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

57 lines
1.3 KiB

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class ParkingReservation extends Model
{
use HasFactory;
protected $table = 'parking_reservation';
protected $fillable
= [
'reserve_id',
'space_type_id',
'space_attr_id',
'license_plate_type',
'license_plate_id',
'is_driver',
'floor_id',
'floor_region_id',
'status',
'confirm_at',
'customer_id',
'member_id',
'channel_id',
'member_type',
'parking_id',
'remark',
'date',
'operation',
'confirm_status',
'cancel_at',
'send_at'
];
protected $hidden = [];
public function getCreatedAtAttribute($value): string
{
return get_datetime('date_time', strtotime($value));
}
public function getConfirmAtAttribute($value): string
{
return is_null($value)
? ''
: get_datetime('date_time', strtotime($value));
}
public static function getReserveId($id)
{
return self::query()->where('id', $id)->value('reserve_id');
}
}