25 lines
670 B
PHP
25 lines
670 B
PHP
<?php
|
|
|
|
namespace App\Services;
|
|
|
|
use App\Models\MisStationarBranch;
|
|
use Illuminate\Support\Facades\Cache;
|
|
|
|
class StationarBranchService
|
|
{
|
|
/**
|
|
* Получение идентификаторов приемных отделений. Кешируется на 24ч
|
|
* @return array
|
|
*/
|
|
public function getWardIds(): array
|
|
{
|
|
return Cache::tags(['wards_ids'])
|
|
->remember('branch_ward_ids', now()->addHours(24), function () {
|
|
return MisStationarBranch::query()
|
|
->where('IsHospitalWard', 1)
|
|
->pluck('StationarBranchID')
|
|
->toArray();
|
|
});
|
|
}
|
|
}
|