From fc2af73274dce1f1d4f731204a26c417c0bc4bf9 Mon Sep 17 00:00:00 2001 From: wucongxing8150 <815046773@qq.com> Date: Wed, 24 Apr 2024 15:01:16 +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=AE1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/PatientOrderService.php | 31 +++++++--------------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/app/Services/PatientOrderService.php b/app/Services/PatientOrderService.php index c343ff8..2c326a0 100644 --- a/app/Services/PatientOrderService.php +++ b/app/Services/PatientOrderService.php @@ -3106,8 +3106,9 @@ class PatientOrderService extends BaseService } // 获取服务包当月已问诊次数 - if ($order_service_package['order_service_status'] == 2){ - $result['order_service_package']['month_inquiry_count'] = 1; + if (!empty($order_service_package['pay_time'])){ + $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']); } // 健康包数据 @@ -3145,27 +3146,11 @@ class PatientOrderService extends BaseService $result['order_product'] = $order_products->toArray(); } -// // 已使用商品数量 -// $used_quantity = 0; -// foreach ($order_products as $order_product){ -// // 获取详情item -// $params = array(); -// $params['order_product_id'] = $order_product['order_product_id']; -// $order_product_items = OrderProductItem::getList($params); -// if (empty($order_product_items)){ -// return fail(HttpEnumCode::SERVER_ERROR); -// } -// -// foreach ($order_product_items as $order_product_item){ -// $used_quantity = $order_product_item["amount"]; -// } -// } -// -// if ($used_quantity > 30){ -// $used_quantity = 30; -// } -// -// $result['order_service_package_product'][0]['remaining_quantity'] = $used_quantity; + // 获取服务包内某一药品的总数量 + $total_quantity = $OrderServicePackageService->getOrderServiceProductTotalQuantity($order_service_package_product['product_id']); + + // 获取服务包内某一药品的剩余数量 + $result['order_service_package_detail']['remaining_quantity'] = $OrderServicePackageService->getOrderServiceProductCanUseQuantity($order_service_package['order_service_id'],$order_service_package_product['product_id'],$total_quantity); } }