新增地址

This commit is contained in:
wucongxing 2023-04-13 18:06:01 +08:00
parent ddb5ce764f
commit 66dd47c3b3
3 changed files with 67 additions and 0 deletions

View File

@ -175,6 +175,17 @@ class PatientOrderController extends AbstractController
return $this->response->json($data); return $this->response->json($data);
} }
/**
* 获取药品订单物流数据
* @return ResponseInterface
*/
public function getPatientProductOrderLogistics(): ResponseInterface
{
$PatientOrderService = new PatientOrderService();
$data = $PatientOrderService->getPatientProductOrderLogistics();
return $this->response->json($data);
}
/** /**
* 获取处方订单列表 * 获取处方订单列表
* @return ResponseInterface * @return ResponseInterface

View File

@ -13,6 +13,7 @@ use App\Model\OrderPrescription;
use App\Model\OrderPrescriptionProduct; use App\Model\OrderPrescriptionProduct;
use App\Model\OrderProduct; use App\Model\OrderProduct;
use App\Model\OrderProductItem; use App\Model\OrderProductItem;
use App\Model\OrderProductLogistic;
use App\Model\PatientFollow; use App\Model\PatientFollow;
use App\Model\Product; use App\Model\Product;
use App\Model\ProductPlatformAmount; use App\Model\ProductPlatformAmount;
@ -1079,6 +1080,58 @@ class PatientOrderService extends BaseService
return success($result); return success($result);
} }
/**
* 获取药品订单物流数据
* @return array
*/
public function getPatientProductOrderLogistics(): array
{
$user_info = $this->request->getAttribute("userInfo") ?? [];
$order_product_id = $this->request->route('order_product_id');
// 获取药品订单数据
$params = array();
$params['order_product_id'] = $order_product_id;
$params['patient_id'] = $user_info['client_user_id'];
$order_product = OrderProduct::getOne($params);
if (empty($order_product)){
return fail();
}
// 获取物流数据
$params = array();
$params['order_product_id'] = $order_product_id;
$order_product_logistics = OrderProductLogistic::getOne($params);
if (empty($order_product_logistics)){
return success(null);
}
$order_product_logistics = $order_product_logistics->toArray();
$order_product_logistics['logistics_content'] = json_decode($order_product_logistics['logistics_content'],true);
// 地址数据
$address = array();
$address['province_id'] = $order_product['province_id'];
$address['province'] = $order_product['province'];
$address['city_id'] = $order_product['city_id'];
$address['city'] = $order_product['city'];
$address['county_id'] = $order_product['county_id'];
$address['county'] = $order_product['county'];
$address['address'] = $order_product['address'];
$address['address_mask'] = $order_product['address_mask'];
$address['consignee_name'] = $order_product['consignee_name'];
$address['consignee_name_mask'] = $order_product['consignee_name_mask'];
$address['consignee_tel'] = $order_product['consignee_tel'];
$address['consignee_tel_mask'] = $order_product['consignee_tel_mask'];
$result = array();
$result['logistics'] = $order_product_logistics;
$result['address'] = $address;
return success($result);
}
/** /**
* 获取处方订单列表 * 获取处方订单列表
* @return array * @return array

View File

@ -381,6 +381,9 @@ Router::addGroup('/patient', function () {
// 创建药品订单 // 创建药品订单
Router::post('', [PatientOrderController::class, 'addPatientProductOrder']); Router::post('', [PatientOrderController::class, 'addPatientProductOrder']);
// 获取药品订单物流数据
Router::get('/logistics/{order_product_id:\d+}', [PatientOrderController::class, 'getPatientProductOrderLogistics']);
}); });
// 处方订单 // 处方订单