修改订单取消成功通知 问题

This commit is contained in:
wucongxing 2023-08-04 17:42:47 +08:00
parent 55bb38d6d9
commit 2159400c44
5 changed files with 54 additions and 6 deletions

View File

@ -287,4 +287,15 @@ class PatientOrderController extends AbstractController
$data = $PatientOrderService->putCancelPatientDetectionOrder();
return $this->response->json($data);
}
/**
* 检测订单取消支付
* @return ResponseInterface
*/
public function putPatientDetectionOrderCancelPay(): ResponseInterface
{
$PatientOrderService = new PatientOrderService();
$data = $PatientOrderService->putPatientDetectionOrderCancelPay();
return $this->response->json($data);
}
}

View File

@ -240,9 +240,8 @@ class DetectionService extends BaseService
$user_doctors = UserDoctor::getDiagnoCoopDoctorList($params,$hospital_params,$fields);
if (!empty($user_doctors)){
foreach ($user_doctors as &$value){
$doctor = array();
if (!empty($value['Hospital'])){
$doctor['hospital_name'] = $value['Hospital']['hospital_name'];
$value['hospital_name'] = $value['Hospital']['hospital_name'];
}
unset($value['Hospital']);

View File

@ -2263,7 +2263,7 @@ class MessagePush extends BaseService
$sub_data = array();
$sub_data['push_user_id'] = $this->user['user_id'];
$sub_data['wx_template_id'] = "5aJSrO8SU5rxqdB99zzl4rMVgcOTjt5mQh56cpZI1Hg";//咨询提醒
$sub_data['params']['page'] = "/pages/checkOrderDetail/checkOrderDetail?order_detection_id=";
$sub_data['params']['page'] = "/pages/checkOrderDetail/checkOrderDetail?order_detection_id=" . $order_detection['order_detection_id'];
$sub_data['params']['data'] = [
"thing1" => $order_detection['patient_name'],// 就诊人
"thing7" => (string)$detection_project['detection_project_name'],// 服务项目

View File

@ -1869,6 +1869,47 @@ class PatientOrderService extends BaseService
return success();
}
/**
* 检测订单取消支付
* @return array
*/
public function putPatientDetectionOrderCancelPay(): array
{
$user_info = $this->request->getAttribute("userInfo") ?? [];
$order_detection_id = $this->request->route('order_detection_id');
Db::beginTransaction();
try {
// 获取订单数据
$params = array();
$params['patient_id'] = $user_info['client_user_id'];
$params['order_detection_id'] = $order_detection_id;
$params['is_delete'] = 0;
$order_detection = OrderDetection::getOne($params);
if (empty($order_detection)) {
return fail();
}
// 检测订单取消
// 取消订单原因1:主动取消 2:客服取消 3:支付超时)
$DetectionService = new DetectionService();
$result = $DetectionService->cancelUnpayDetectionOrder($order_detection['detection_no'], 3, "支付超时");
if ($result['status'] != 1) {
Db::rollBack();
return fail();
}
Db::commit();
} catch (\Exception $e) {
Db::rollBack();
return fail(HttpEnumCode::HTTP_ERROR, $e->getMessage());
}
return success();
}
/**
* 获取患者未完成订单
* @param string $patient_id

View File

@ -278,9 +278,6 @@ Router::addGroup('/patient', function () {
// 获取检测机构合作医生列表
Router::get('/doctor', [DetectionController::class, 'getDetectionDoctorList']);
// 获取患者进行中的订单
Router::get('/progress-order', [DetectionController::class, 'getDetectionDoctorList']);
// 检测项目
Router::addGroup('/project', function () {
// 获取合作公司检测项目列表