修改处方药品数据获取方式
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Services;
|
||||
|
||||
use App\Model\OrderPrescription;
|
||||
use App\Model\OrderPrescriptionProduct;
|
||||
use App\Model\OrderProductItem;
|
||||
use Hyperf\Contract\LengthAwarePaginatorInterface;
|
||||
|
||||
@@ -59,7 +60,7 @@ class OrderPrescriptionService extends BaseService
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取处方订单中开方商品数据
|
||||
* 获取处方中开方药品
|
||||
* @param string|int $order_inquiry_id
|
||||
* @param string|int $order_prescription_id
|
||||
* @return array
|
||||
@@ -69,23 +70,25 @@ class OrderPrescriptionService extends BaseService
|
||||
$params = array();
|
||||
$params['order_inquiry_id'] = $order_inquiry_id;
|
||||
$params['order_prescription_id'] = $order_prescription_id;
|
||||
$order_product_items = OrderProductItem::getWithProductList($params);
|
||||
if(empty($order_product_items)){
|
||||
$order_prescription_products = OrderPrescriptionProduct::getWithProductList($params);
|
||||
if(empty($order_prescription_products)){
|
||||
return [];
|
||||
}
|
||||
|
||||
$result = [];
|
||||
|
||||
foreach ($order_product_items as $order_product_item){
|
||||
foreach ($order_prescription_products as $order_prescription_product){
|
||||
$data = array();
|
||||
$data['product_item_id'] = $order_product_item['product_item_id'];
|
||||
$data['product_id'] = $order_product_item['product_id'];
|
||||
$data['amount'] = $order_product_item['amount'];
|
||||
$data['product_cover_img'] = addAliyunOssWebsite($order_product_item['product_cover_img']);
|
||||
$data['single_unit'] = $order_product_item['Product']['single_unit'];
|
||||
$data['single_use'] = $order_product_item['Product']['single_use'];
|
||||
$data['packaging_unit'] = $order_product_item['Product']['packaging_unit'];
|
||||
$data['frequency_use'] = $order_product_item['Product']['frequency_use'];
|
||||
$data['prescription_product_id'] = $order_prescription_product['prescription_product_id'];
|
||||
$data['product_id'] = $order_prescription_product['product_id'];
|
||||
$data['prescription_product_num'] = $order_prescription_product['prescription_product_num'];
|
||||
$data['product_name'] = $order_prescription_product['Product']['product_name'];
|
||||
$data['product_cover_img'] = addAliyunOssWebsite($order_prescription_product['Product']['product_cover_img']);
|
||||
$data['product_spec'] = $order_prescription_product['Product']['product_spec'];
|
||||
$data['single_unit'] = $order_prescription_product['Product']['single_unit'];
|
||||
$data['single_use'] = $order_prescription_product['Product']['single_use'];
|
||||
$data['packaging_unit'] = $order_prescription_product['Product']['packaging_unit'];
|
||||
$data['frequency_use'] = $order_prescription_product['Product']['frequency_use'];
|
||||
|
||||
$result[] = $data;
|
||||
}
|
||||
|
||||
@@ -848,12 +848,14 @@ class UserDoctorService extends BaseService
|
||||
|
||||
// 订单-商品订单列表
|
||||
$OrderPrescriptionService = new OrderPrescriptionService();
|
||||
$order_product_items = $OrderPrescriptionService->getproductList($order_inquiry_id,$order_prescription_id);
|
||||
$order_prescription_product = $OrderPrescriptionService->getproductList($order_inquiry_id,$order_prescription_id);
|
||||
|
||||
// 获取处方关联疾病表
|
||||
}
|
||||
|
||||
$result = array();
|
||||
$result['inquiry_case_product'] = $inquiry_case_product;// 用药意向
|
||||
$result['order_product_items'] = $order_product_items ?? [];// 开方药品
|
||||
$result['order_prescription_product'] = $order_prescription_product ?? [];// 开方药品
|
||||
$result['case'] = $order_inquiry_case;// 病例数据
|
||||
$result['prescription']['doctor_advice'] = $order_prescription['doctor_advice'] ?? "";// 医嘱
|
||||
|
||||
|
||||
Reference in New Issue
Block a user