修正获取医生评价
This commit is contained in:
@@ -23,6 +23,7 @@ use App\Model\SystemInquiryConfig;
|
||||
use App\Model\UserCoupon;
|
||||
use App\Model\UserDoctor;
|
||||
use App\Model\UserPatient;
|
||||
use App\Utils\Log;
|
||||
use App\Utils\Mask;
|
||||
use App\Utils\PcreMatch;
|
||||
use Extend\Wechat\WechatPay;
|
||||
@@ -264,7 +265,8 @@ class InquiryService extends BaseService
|
||||
|
||||
// 增加至取消订单延迟队列
|
||||
$data = array();
|
||||
$data['order_inquiry_id'] = $order_inquiry['order_inquiry_id'];
|
||||
$data['order_no'] = $order_inquiry['inquiry_no'];
|
||||
$data['order_type'] = 1;
|
||||
|
||||
$message = new CancelUnpayOrdersDelayDirectProducer($data);
|
||||
$message->setDelayMs(1000 * 60 * 30);
|
||||
@@ -323,12 +325,14 @@ class InquiryService extends BaseService
|
||||
$order_inquiry_case['weight'] = $order_inquiry_case['weight'] ?: $patient_family['weight'] ?: NULL;
|
||||
$order_inquiry_case['job_name'] = $patient_family['job_name'] ?? "";
|
||||
$order_inquiry_case['nation_name'] = $patient_family['nation_name'] ?? "";
|
||||
$order_inquiry_case['marital_status'] = $patient_family['marital_status'] ?? 0;
|
||||
|
||||
// 获取患者家庭成员信息表-健康情况
|
||||
$params = array();
|
||||
$params['family_id'] = $order_inquiry_case['family_id'];
|
||||
$patient_family_health = PatientFamilyHealth::getOne($params);
|
||||
$order_inquiry_case['diagnosis_hospital'] = $patient_family_health['diagnosis_hospital'] ?? "";
|
||||
$order_inquiry_case['drugs_name'] = $patient_family_health['drugs_name'] ?? "";
|
||||
|
||||
// 获取患者家庭成员信息表-个人情况
|
||||
$params = array();
|
||||
@@ -749,4 +753,6 @@ class InquiryService extends BaseService
|
||||
$params['order_inquiry_id'] = $order_inquiry['order_inquiry_id'];
|
||||
OrderInquiry::edit($params, $data);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -550,7 +550,7 @@ class PatientOrderService extends BaseService
|
||||
$data['order_product_status'] = 5;
|
||||
$data['cancel_time'] = date("Y-m-d H:i:s",time());
|
||||
$data['cancel_reason'] = 1; // 订单取消原因(1:主动取消 2:复核失败/库存不足 3:支付超时
|
||||
$data['cancel_remarks'] = "主动取消";
|
||||
$data['cancel_remarks'] = 2; // 取消订单原因(1:医生未接诊 2:主动取消 3:无可分配医生 4:客服取消 5:支付超时)
|
||||
$data['updated_at'] = date("Y-m-d H:i:s",time());
|
||||
|
||||
$params = array();
|
||||
@@ -769,18 +769,26 @@ class PatientOrderService extends BaseService
|
||||
return fail(HttpEnumCode::HTTP_ERROR,"收货地址错误");
|
||||
}
|
||||
|
||||
|
||||
$amount_total = 0;
|
||||
$coupon_amount_total = 0;
|
||||
$logistics_fee = 0; // 运费金额
|
||||
|
||||
// 检测药品是否存在,库存是否足够,获取订单金额
|
||||
foreach ($order_prescription_product as $value){
|
||||
$params = array();
|
||||
$params['product_id'] = $value['product_id'];
|
||||
$product = Product::getOne($params);
|
||||
if (empty($product)){
|
||||
return fail(HttpEnumCode::HTTP_ERROR,"处方存在未知药品");
|
||||
$product = Product::getWithAmountOne($params);
|
||||
if (empty($product)) {
|
||||
Db::rollBack();
|
||||
return fail(HttpEnumCode::HTTP_ERROR, "处方存在未知药品");
|
||||
}
|
||||
|
||||
// 检测商品库存
|
||||
if (!empty($product['ProductPlatformAmount'])) {
|
||||
if ($value['prescription_product_num'] > $product['ProductPlatformAmount']['real_stock']) {
|
||||
// 此处是否需要特殊返回
|
||||
Db::rollBack();
|
||||
return fail(HttpEnumCode::HTTP_ERROR, "意向药品库存不足");
|
||||
}
|
||||
}
|
||||
|
||||
$amount_total += $product['product_price'];
|
||||
@@ -882,9 +890,6 @@ class PatientOrderService extends BaseService
|
||||
return fail(HttpEnumCode::SERVER_ERROR, $e->getMessage());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return success();
|
||||
}
|
||||
|
||||
@@ -987,7 +992,7 @@ class PatientOrderService extends BaseService
|
||||
// 获取处方药品信息
|
||||
$params = array();
|
||||
$params['order_prescription_id'] = $order_prescription['order_prescription_id'];
|
||||
$order_prescription_product = OrderPrescriptionProduct::getWithProductList($params);
|
||||
$order_prescription_product = OrderPrescriptionProduct::getList($params);
|
||||
if (empty($order_prescription_product)){
|
||||
return fail(HttpEnumCode::SERVER_ERROR);
|
||||
}
|
||||
@@ -996,9 +1001,22 @@ class PatientOrderService extends BaseService
|
||||
$coupon_amount_total = 0;
|
||||
$logistics_fee = 0; // 运费金额
|
||||
foreach ($order_prescription_product as $item){
|
||||
if (!empty($item['Product']['product_price'])){
|
||||
$amount_total += $item['Product']['product_price'];
|
||||
$params = array();
|
||||
$params['product_id'] = $item['product_id'];
|
||||
$product = Product::getWithAmountOne($params);
|
||||
if (empty($product)) {
|
||||
return fail(HttpEnumCode::HTTP_ERROR, "处方存在未知药品");
|
||||
}
|
||||
|
||||
// 检测商品库存
|
||||
if (!empty($product['ProductPlatformAmount'])) {
|
||||
if ($item['prescription_product_num'] > $product['ProductPlatformAmount']['real_stock']) {
|
||||
// 库存不足
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$amount_total += $product['product_price'];
|
||||
}
|
||||
|
||||
// 获取运费金额
|
||||
|
||||
@@ -640,7 +640,7 @@ class UserDoctorService extends BaseService
|
||||
return fail();
|
||||
}
|
||||
|
||||
$order_evaluation = OrderEvaluation::getScorePage($params, $avg_score_params,$page,$per_page);
|
||||
$order_evaluation = OrderEvaluation::getScorePage($params, $avg_score_params,['*'],$page,$per_page);
|
||||
if (!empty($order_evaluation['data'])) {
|
||||
foreach ($order_evaluation['data'] as &$item) {
|
||||
$item['avg_score'] = floor($item['avg_score'] * 0.05);
|
||||
|
||||
Reference in New Issue
Block a user