新增银行列表接口
This commit is contained in:
parent
757cd2e76e
commit
ad24a7ce91
@ -40,4 +40,15 @@ class BasicDataController extends AbstractController
|
|||||||
$data = $BasicDataService->getCustomDepartment();
|
$data = $BasicDataService->getCustomDepartment();
|
||||||
return $this->response->json($data);
|
return $this->response->json($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取银行列表
|
||||||
|
* @return ResponseInterface
|
||||||
|
*/
|
||||||
|
public function getBank(): ResponseInterface
|
||||||
|
{
|
||||||
|
$BasicDataService = new BasicDataService();
|
||||||
|
$data = $BasicDataService->getBank();
|
||||||
|
return $this->response->json($data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -6,6 +6,7 @@ namespace App\Model;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
use Hyperf\Database\Model\Collection;
|
||||||
use Hyperf\Snowflake\Concern\Snowflake;
|
use Hyperf\Snowflake\Concern\Snowflake;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -52,9 +53,9 @@ class BasicBank extends Model
|
|||||||
* 获取信息-多条
|
* 获取信息-多条
|
||||||
* @param array $params
|
* @param array $params
|
||||||
* @param array $fields
|
* @param array $fields
|
||||||
* @return object|null
|
* @return Collection|array
|
||||||
*/
|
*/
|
||||||
public static function getList(array $params, array $fields = ['*']): object|null
|
public static function getList(array $params, array $fields = ['*']): Collection|array
|
||||||
{
|
{
|
||||||
return self::where($params)->get($fields);
|
return self::where($params)->get($fields);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Services;
|
namespace App\Services;
|
||||||
|
|
||||||
|
use App\Model\BasicBank;
|
||||||
use App\Model\Hospital;
|
use App\Model\Hospital;
|
||||||
use App\Model\HospitalDepartmentCustom;
|
use App\Model\HospitalDepartmentCustom;
|
||||||
|
|
||||||
@ -73,4 +74,18 @@ class BasicDataService extends BaseService
|
|||||||
|
|
||||||
return success($hospital_department_custom->toArray());
|
return success($hospital_department_custom->toArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取银行列表
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getBank(): array
|
||||||
|
{
|
||||||
|
$basic_bank = BasicBank::getList([]);
|
||||||
|
if (empty($basic_bank)){
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
return success($basic_bank->toArray());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -215,5 +215,8 @@ Router::addGroup('/basic', function () {
|
|||||||
|
|
||||||
// 获取自定义科室数据
|
// 获取自定义科室数据
|
||||||
Router::get('/department', [BasicDataController::class, 'getCustomDepartment']);
|
Router::get('/department', [BasicDataController::class, 'getCustomDepartment']);
|
||||||
|
|
||||||
|
// 获取银行列表
|
||||||
|
Router::get('/bank', [BasicDataController::class, 'getBank']);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user