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.
31 lines
723 B
31 lines
723 B
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class ParkingOccupancyRateInfo extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $table = 'parking_occupancy_rate_info';
|
|
|
|
public $timestamps = false;
|
|
|
|
protected $fillable
|
|
= [
|
|
'occupancy_rate_id',
|
|
'space_type_id',
|
|
'sum_count',
|
|
'occupy_count'
|
|
];
|
|
|
|
public static function getTypeCount($occupancy_rate_id, $space_type_id)
|
|
{
|
|
return self::query()->where([
|
|
'occupancy_rate_id' => $occupancy_rate_id,
|
|
'space_type_id' => $space_type_id
|
|
])->first(['sum_count', 'occupy_count']);
|
|
}
|
|
}
|
|
|