修正获取服务包关联问诊订单消息内页基础数据5
This commit is contained in:
parent
dac179e845
commit
de9a666b79
@ -1248,7 +1248,7 @@ class OrderServicePackageService extends BaseService
|
||||
{
|
||||
$params = array();
|
||||
$params['package_id'] = $package_id;
|
||||
$health_package_products = HealthPackage::getList($params);
|
||||
$health_package_products = HealthPackageProduct::getList($params);
|
||||
if (empty($health_package_products)){
|
||||
return [];
|
||||
}
|
||||
@ -1258,22 +1258,16 @@ class OrderServicePackageService extends BaseService
|
||||
|
||||
/**
|
||||
* 获取服务包内某一药品的总数量
|
||||
* @param string|int $package_id
|
||||
* @param string|int $product_id
|
||||
* @return int
|
||||
*/
|
||||
public function getOrderServiceProductTotalQuantity(string|int $product_id): int
|
||||
public function getOrderServiceProductTotalQuantity(string|int $package_id,string|int $product_id): int
|
||||
{
|
||||
$total_quantity = 0;
|
||||
|
||||
// 获取健康包内容
|
||||
$params = array();
|
||||
$health_package = HealthPackage::getOne($params);
|
||||
if (empty($health_package)){
|
||||
return $total_quantity;
|
||||
}
|
||||
|
||||
$params = array();
|
||||
$params['package_id'] = $health_package['package_id'];
|
||||
$params['package_id'] = $package_id;
|
||||
$params['product_id'] = $product_id;
|
||||
$health_package_product = HealthPackage::getOne($params);
|
||||
if (empty($health_package_product)){
|
||||
|
||||
@ -3147,11 +3147,8 @@ class PatientOrderService extends BaseService
|
||||
$health_package_products = $OrderServicePackageService->getOrderServiceProduct($order_service_package_detail['package_id']);
|
||||
if (!empty($health_package_products)) {
|
||||
foreach ($health_package_products as $health_package_product) {
|
||||
// 获取服务包内某一药品的总数量
|
||||
$total_quantity = $OrderServicePackageService->getOrderServiceProductTotalQuantity($health_package_product['product_id']);
|
||||
|
||||
// 获取服务包内某一药品的剩余数量
|
||||
$result['order_service_package_detail']['remaining_quantity'] = $OrderServicePackageService->getOrderServiceProductCanUseQuantity($order_service_package['order_service_id'],$health_package_product['product_id'],$total_quantity);
|
||||
$result['order_service_package_detail']['remaining_quantity'] = $OrderServicePackageService->getOrderServiceProductCanUseQuantity($order_service_package['order_service_id'],$health_package_product['product_id'],$health_package_product['quantity']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user