init
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace plugin\admin\app\service;
|
||||
|
||||
use plugin\admin\app\repository\HospitalRepository;
|
||||
|
||||
class HospitalService extends BaseService
|
||||
{
|
||||
private HospitalRepository $repository;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->repository = HospitalRepository::new();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取医院下拉选项(用于其他模块选择医院)
|
||||
*/
|
||||
public function getHospitalOptions(): array
|
||||
{
|
||||
return $this->repository->getListWithPermission()
|
||||
->map(fn($item) => [
|
||||
'value' => $item->id,
|
||||
'name' => $item->organ_name,
|
||||
])
|
||||
->toArray();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user