获取患者进行中的检测订单
This commit is contained in:
parent
2159400c44
commit
cefe11b02b
@ -54,7 +54,12 @@ class DetectionController extends AbstractController
|
||||
return $this->response->json($data);
|
||||
}
|
||||
|
||||
// 创建检测订单
|
||||
/**
|
||||
* 创建检测订单
|
||||
* @return ResponseInterface
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function addDetectionOrder(): ResponseInterface
|
||||
{
|
||||
$request = $this->container->get(DetectionRequest::class);
|
||||
@ -64,4 +69,20 @@ class DetectionController extends AbstractController
|
||||
$data = $detectionService->addDetectionOrder();
|
||||
return $this->response->json($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取患者进行中的检测订单
|
||||
* @return ResponseInterface
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function getDetectionDoctorOrderFirst(): ResponseInterface
|
||||
{
|
||||
$request = $this->container->get(DetectionRequest::class);
|
||||
$request->scene('getDetectionDoctorOrderFirst')->validateResolved();
|
||||
|
||||
$detectionService = new DetectionService();
|
||||
$data = $detectionService->getDetectionDoctorOrderFirst();
|
||||
return $this->response->json($data);
|
||||
}
|
||||
}
|
||||
@ -21,6 +21,9 @@ class DetectionRequest extends FormRequest
|
||||
'doctor_id', // 医生id
|
||||
'client_type', // 客户端类型(1:手机 2:电脑)
|
||||
],
|
||||
'getDetectionDoctorOrderFirst' => [ // 创建检测订单
|
||||
'family_id',
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
@ -470,6 +470,29 @@ class DetectionService extends BaseService
|
||||
return success($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取患者进行中的检测订单
|
||||
* @return array
|
||||
*/
|
||||
public function getDetectionDoctorOrderFirst(): array
|
||||
{
|
||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||
|
||||
$family_id = $this->request->input("family_id");
|
||||
|
||||
// 检测是否存在同类型未完成的检测订单
|
||||
$params = array();
|
||||
$params['patient_id'] = $user_info['client_user_id'];
|
||||
$params['family_id'] = $family_id;
|
||||
$order_detection = OrderDetection::getOne($params);
|
||||
if (empty($order_detection)){
|
||||
return success();
|
||||
}
|
||||
|
||||
return success($order_detection['order_detection_id']);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消未支付检测订单
|
||||
* @param string|int $order_no 订单编号
|
||||
|
||||
@ -275,6 +275,9 @@ Router::addGroup('/patient', function () {
|
||||
]
|
||||
);
|
||||
|
||||
// 获取患者进行中的检测订单
|
||||
Router::get('', [DetectionController::class, 'getDetectionDoctorOrderFirst']);
|
||||
|
||||
// 获取检测机构合作医生列表
|
||||
Router::get('/doctor', [DetectionController::class, 'getDetectionDoctorList']);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user