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.
41 lines
790 B
41 lines
790 B
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class ParkingAccessRecord extends Model
|
|
{
|
|
|
|
use HasFactory;
|
|
|
|
protected $table = 'parking_access_record';
|
|
|
|
protected $fillable
|
|
= [
|
|
'floor_id',
|
|
'license_plate_id',
|
|
'space_id',
|
|
'status',
|
|
'enter_time',
|
|
'leave_time',
|
|
'scene_image'
|
|
];
|
|
|
|
protected $hidden = [
|
|
'created_at',
|
|
'updated_at'
|
|
];
|
|
|
|
public function getEnterTimeAttribute($value): string
|
|
{
|
|
return date('Y-m-d H:i:s', $value);
|
|
}
|
|
|
|
public function getLeaveTimeAttribute($value): string
|
|
{
|
|
return $value ? date('Y-m-d H:i:s', $value) : '';
|
|
}
|
|
|
|
}
|
|
|