diff --git a/app/Services/PatientOrderService.php b/app/Services/PatientOrderService.php index a7b0e51..3d16e6d 100644 --- a/app/Services/PatientOrderService.php +++ b/app/Services/PatientOrderService.php @@ -1008,19 +1008,24 @@ class PatientOrderService extends BaseService return fail(HttpEnumCode::HTTP_ERROR, "存在库存不足商品", $not_enough_product_ids); } - // 获取运费金额 - $Prescription = new Prescription(); + $app_env = config('app_env','prod'); + if ($app_env != "dev"){ + // 获取运费金额 + $Prescription = new Prescription(); - $result = $Prescription->getLogisticsFee(); - if ($amount_total >= $result['drugCost']){ - $logistics_fee = 0; - }else{ - $logistics_fee = $result['freight']; + $result = $Prescription->getLogisticsFee(); + if ($amount_total >= $result['drugCost']){ + $logistics_fee = 0; + }else{ + $logistics_fee = $result['freight']; + } + + // 实际支付金额 + $payment_amount_total = $amount_total + $logistics_fee; } - // 实际支付金额 - $payment_amount_total = $amount_total + $logistics_fee; - if (env("APP_ENV") == "dev"){ + if ($app_env == "dev"){ + $logistics_fee = 0; $payment_amount_total = 0.01; }