72 lines
2.4 KiB
PHP
72 lines
2.4 KiB
PHP
<?php
|
|
|
|
namespace App\Controller;
|
|
|
|
use App\Request\OrderServicePackageRequest;
|
|
use App\Request\PatientOrderRequest;
|
|
use App\Request\UserPatientRequest;
|
|
use App\Services\OrderServicePackageService;
|
|
use App\Services\PatientOrderService;
|
|
use App\Services\UserPatientService;
|
|
use Psr\Container\ContainerExceptionInterface;
|
|
use Psr\Container\NotFoundExceptionInterface;
|
|
use Psr\Http\Message\ResponseInterface;
|
|
|
|
class OrderServicePackageController extends AbstractController
|
|
{
|
|
/**
|
|
* 获取患者已购买的某医生的服务包详情
|
|
* @return ResponseInterface
|
|
* @throws ContainerExceptionInterface
|
|
* @throws NotFoundExceptionInterface
|
|
*/
|
|
public function getPatientBuyServiceDetail(): ResponseInterface
|
|
{
|
|
$request = $this->container->get(OrderServicePackageRequest::class);
|
|
$request->scene('getPatientBuyServiceDetail')->validateResolved();
|
|
|
|
$OrderServicePackageService = new OrderServicePackageService();
|
|
$data = $OrderServicePackageService->getPatientBuyServiceDetail();
|
|
return $this->response->json($data);
|
|
}
|
|
|
|
/**
|
|
* 创建服务包订单
|
|
* @return ResponseInterface
|
|
* @throws ContainerExceptionInterface
|
|
* @throws NotFoundExceptionInterface
|
|
*/
|
|
public function addPatientServiceOrder(): ResponseInterface
|
|
{
|
|
$request = $this->container->get(OrderServicePackageRequest::class);
|
|
$request->scene('addPatientServiceOrder')->validateResolved();
|
|
|
|
$OrderServicePackageService = new OrderServicePackageService();
|
|
$data = $OrderServicePackageService->addPatientServiceOrder();
|
|
return $this->response->json($data);
|
|
}
|
|
|
|
/**
|
|
* 创建服务包问诊订单
|
|
* @return ResponseInterface
|
|
* @throws ContainerExceptionInterface
|
|
* @throws NotFoundExceptionInterface
|
|
*/
|
|
public function addServiceInquiryOrder(): ResponseInterface
|
|
{
|
|
$OrderServicePackageService = new OrderServicePackageService();
|
|
$data = $OrderServicePackageService->addServiceInquiryOrder();
|
|
return $this->response->json($data);
|
|
}
|
|
|
|
/**
|
|
* 检测是否可创建服务包问诊订单
|
|
* @return ResponseInterface
|
|
*/
|
|
public function getServicePackageInquiryCheck(): ResponseInterface
|
|
{
|
|
$OrderServicePackageService = new OrderServicePackageService();
|
|
$data = $OrderServicePackageService->getServicePackageInquiryCheck();
|
|
return $this->response->json($data);
|
|
}
|
|
} |