修正检测是否可接诊、新增问诊订单属性获取
This commit is contained in:
@@ -704,7 +704,45 @@ class PatientOrderService extends BaseService
|
||||
return success($result);
|
||||
}
|
||||
|
||||
public function addPatientProductOrder(){
|
||||
// 创建药品订单
|
||||
public function addPatientProductOrder(): array
|
||||
{
|
||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||
|
||||
$order_prescription_id = $this->request->input('order_prescription_id');
|
||||
$address_id = $this->request->input('address_id');
|
||||
|
||||
// 获取处方数据
|
||||
$params = array();
|
||||
$params['order_prescription_id'] = $order_prescription_id;
|
||||
$params['patient_id'] = $user_info['client_user_id'];
|
||||
$params['is_delete'] = 0;
|
||||
$order_prescription = OrderPrescription::getOne($params);
|
||||
if (empty($order_prescription)){
|
||||
return fail();
|
||||
}
|
||||
|
||||
// 验证处方状态
|
||||
if ($order_prescription['prescription_status'] == 1){
|
||||
return fail(HttpEnumCode::HTTP_ERROR,"处方未审核");
|
||||
}
|
||||
|
||||
if ($order_prescription['prescription_status'] == 3){
|
||||
return fail(HttpEnumCode::HTTP_ERROR,"已失效");
|
||||
}
|
||||
if ($order_prescription['prescription_status'] == 4){
|
||||
return fail(HttpEnumCode::HTTP_ERROR,"已使用");
|
||||
}
|
||||
|
||||
// if (¥)
|
||||
|
||||
|
||||
// 检测是否已经存在药品订单数据
|
||||
// 新增药品订单
|
||||
// 新增药品订单详情
|
||||
// 修正处方使用状态
|
||||
// 新增取消订单队列
|
||||
|
||||
return success();
|
||||
}
|
||||
|
||||
@@ -852,7 +890,40 @@ class PatientOrderService extends BaseService
|
||||
return success($result);
|
||||
}
|
||||
|
||||
public function deletePatientPrescriptionOrder(){
|
||||
/**
|
||||
* 删除处方订单记录
|
||||
* @return array
|
||||
*/
|
||||
public function deletePatientPrescriptionOrder(): array
|
||||
{
|
||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||
|
||||
$order_prescription_id = $this->request->route('order_prescription_id');
|
||||
|
||||
$params = array();
|
||||
$params['order_prescription_id'] = $order_prescription_id;
|
||||
$params['patient_id'] = $user_info['client_user_id'];
|
||||
$order_prescription = OrderPrescription::getOne($params);
|
||||
if (empty($order_prescription)){
|
||||
return fail();
|
||||
}
|
||||
|
||||
// 验证处方状态
|
||||
if ($order_prescription['prescription_status'] == 1){
|
||||
return fail(HttpEnumCode::HTTP_ERROR,"处方无法删除");
|
||||
}
|
||||
|
||||
if ($order_prescription['is_delete'] == 1){
|
||||
return success();
|
||||
}
|
||||
|
||||
$data = array();
|
||||
$data['is_delete'] = 1;
|
||||
|
||||
$params = array();
|
||||
$params['order_prescription_id'] = $order_prescription['order_prescription_id'];
|
||||
OrderPrescription::edit($params,$data);
|
||||
|
||||
return success();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user