From 666cd06c8258a7fc5bf31ae8337712953a4cabc1 Mon Sep 17 00:00:00 2001 From: wucongxing8150 <815046773@qq.com> Date: Wed, 24 Apr 2024 16:25:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E8=8E=B7=E5=8F=96=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=8C=85=E5=85=B3=E8=81=94=E9=97=AE=E8=AF=8A=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E6=B6=88=E6=81=AF=E5=86=85=E9=A1=B5=E5=9F=BA=E7=A1=80?= =?UTF-8?q?=E6=95=B0=E6=8D=AE6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/PatientOrderService.php | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/app/Services/PatientOrderService.php b/app/Services/PatientOrderService.php index b4f3f0e..f9b3cbd 100644 --- a/app/Services/PatientOrderService.php +++ b/app/Services/PatientOrderService.php @@ -3100,17 +3100,31 @@ class PatientOrderService extends BaseService $result['order_service_package']['current_month_start_date'] = $current_month_date['current_month_start_date']; $result['order_service_package']['current_month_finish_date'] = $current_month_date['current_month_finish_date']; - // 获取服务包当月已问诊次数 - if (!empty($order_service_package['pay_time'])){ + // 获取服务包当月已问诊/剩余次数 + if ($order_service_package_detail['monthly_frequency'] != 0) { $OrderServicePackageService = new OrderServicePackageService(); - $result['order_service_package_detail']['month_inquiry_count'] = $OrderServicePackageService->getCurrentMonthInquiryCount($order_service_package['pay_time'], $order_service_package['order_service_type'], $order_service_package['user_id'], $order_service_package['doctor_id']); + + // 获取服务包当月已问诊次数 + $month_inquiry_count = $OrderServicePackageService->getCurrentMonthInquiryCount($order_service_package['pay_time'],$order_service_package['order_service_type'],$order_service_package['user_id'], $order_service_package['doctor_id']); + + // 获取服务包当月剩余问诊次数 + $remaining_inquiry_count = $order_service_package_detail['monthly_frequency'] - $month_inquiry_count; + if ($remaining_inquiry_count < 0){ + $remaining_inquiry_count = 0; + } + }else{ + $remaining_inquiry_count = "不限"; + $month_inquiry_count = "不限"; } + + $result['order_service_package_detail']['month_inquiry_count'] = $month_inquiry_count; + $result['order_service_package_detail']['remaining_inquiry_count'] = $remaining_inquiry_count; } } // 健康包数据 if ($order_service_package['order_service_type'] == 1){ - // 健康包商品数据 + // 健康包商品订单数据 $params = array(); $params['order_service_id'] = $order_service_package['order_service_id']; $order_service_package_products = OrderServicePackageProduct::getList($params);