|
|
|
@ -31,14 +31,16 @@ class ParkingChannel extends Model |
|
|
|
|
|
|
|
public static function getData() |
|
|
|
{ |
|
|
|
return self::query()->select(['id', 'name'])->get()->each(function ($item) { |
|
|
|
$item['name'] = AdminTranslationService::getTranslationTypeName( |
|
|
|
$item['id'], |
|
|
|
6, |
|
|
|
$item['name'] |
|
|
|
); |
|
|
|
return $item; |
|
|
|
}); |
|
|
|
return self::query()->select(['id', 'name'])->get()->each( |
|
|
|
function ($item) { |
|
|
|
$item['name'] = AdminTranslationService::getTranslationTypeName( |
|
|
|
$item['id'], |
|
|
|
6, |
|
|
|
$item['name'] |
|
|
|
); |
|
|
|
return $item; |
|
|
|
} |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -56,6 +58,26 @@ class ParkingChannel extends Model |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public static function getIds($parking_id) |
|
|
|
{ |
|
|
|
return self::query()->where('parking_id', $parking_id)->pluck('id'); |
|
|
|
} |
|
|
|
|
|
|
|
public static function getParkingId($id) |
|
|
|
{ |
|
|
|
return self::query()->where('id', $id)->value('parking_id'); |
|
|
|
} |
|
|
|
|
|
|
|
public static function getName($id) |
|
|
|
{ |
|
|
|
$name = self::query()->where('id', $id)->value('name'); |
|
|
|
return AdminTranslationService::getTranslationTypeName( |
|
|
|
$id, |
|
|
|
6, |
|
|
|
$name |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
public function getCreatedAtAttribute($value): string |
|
|
|
{ |
|
|
|
return $value ? date("Y-m-d H:i:s", strtotime($value)) : $value; |
|
|
|
|