停车场管理系统
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.
 
 

40 lines
915 B

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class AdminFloorRegion extends Model
{
use HasFactory;
protected $table = 'admin_floor_region';
protected $hidden
= [
'created_at',
'updated_at',
'deleted_at'
];
/**
* @param int $floor_id
* @return array
*/
public static function getFloorRegion(int $floor_id): array
{
$columns = ['id', 'name'];
return self::query()->where('floor_id', $floor_id)->select($columns)
->get()->toArray();
}
public static function existsRoleMenu($floor_id, $nameArr): bool
{
$count = count($nameArr);
$existsCount = self::query()->where('floor_id', $floor_id)
->whereIn('name', $nameArr)->count();
return $count != $existsCount;
}
}