From ac5467b9513a9124a943ce4b537dbf50d9599d7f Mon Sep 17 00:00:00 2001 From: wucongxing <815046773@qq.com> Date: Fri, 7 Apr 2023 17:59:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E8=BF=94=E5=9B=9E=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/DoctorAccountService.php | 8 +++---- app/Services/InquiryService.php | 34 +++++++++++++-------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/app/Services/DoctorAccountService.php b/app/Services/DoctorAccountService.php index fa4897b..2f267bd 100644 --- a/app/Services/DoctorAccountService.php +++ b/app/Services/DoctorAccountService.php @@ -208,7 +208,7 @@ class DoctorAccountService extends BaseService // 计算医生个人所得税 $income_tax = $this->computeIndividualIncomeTax($balance_account); - $withdrawal_amount = floor(($balance_account - $income_tax) * 100) / 100; + $withdrawal_amount = floor(($balance_account * 0.75 - $income_tax) * 100) / 100; $income_tax = floor($income_tax * 100) / 100; @@ -298,19 +298,19 @@ class DoctorAccountService extends BaseService /** * 获取医生账户余额 * @param string $doctor_id - * @return int + * @return float */ - public function getDoctorBalanceAccount(string $doctor_id): int + public function getDoctorBalanceAccount(string $doctor_id): float { $params = array(); $params['doctor_id'] = $doctor_id; $doctor_account = DoctorAccount::getOne($params); + if (empty($doctor_account)) { $balance_account = 0; } else { $balance_account = $doctor_account['balance_account']; } - return $balance_account; } diff --git a/app/Services/InquiryService.php b/app/Services/InquiryService.php index 1f8c586..112d21c 100644 --- a/app/Services/InquiryService.php +++ b/app/Services/InquiryService.php @@ -855,23 +855,23 @@ class InquiryService extends BaseService throw new BusinessException("订单数据为空"); } -// // 检测问诊订单状态 -// if (!in_array($order_inquiry['inquiry_status'], [2, 3, 4, 5, 7])) { -// // 问诊订单状态(1:待支付 2:待分配 3:待接诊 4:已接诊 5:已完成 6:已结束 7:已取消) -// throw new BusinessException("订单状态错误"); -// } -// -// // 检测订单退款状态 -// if (in_array($order_inquiry['inquiry_refund_status'], [2, 3, 5])) { -// // 问诊订单退款状态(0:无退款 1:申请退款 2:退款中 3:退款成功 4:拒绝退款 5:退款关闭) -// throw new BusinessException("订单退款状态错误"); -// } -// -// // 检测支付状态 -// if ($order_inquiry['inquiry_pay_status'] != 2) { -// // 支付状态(1:未支付 2:已支付 3:支付中 4:支付失败 5:支付超时 6:支付关闭 7:已撤销 8:转入退款) -// throw new BusinessException("订单支付状态错误"); -// } + // 检测问诊订单状态 + if (!in_array($order_inquiry['inquiry_status'], [2, 3, 4, 5, 7])) { + // 问诊订单状态(1:待支付 2:待分配 3:待接诊 4:已接诊 5:已完成 6:已结束 7:已取消) + throw new BusinessException("订单状态错误"); + } + + // 检测订单退款状态 + if (in_array($order_inquiry['inquiry_refund_status'], [2, 3, 5])) { + // 问诊订单退款状态(0:无退款 1:申请退款 2:退款中 3:退款成功 4:拒绝退款 5:退款关闭) + throw new BusinessException("订单退款状态错误"); + } + + // 检测支付状态 + if ($order_inquiry['inquiry_pay_status'] != 2) { + // 支付状态(1:未支付 2:已支付 3:支付中 4:支付失败 5:支付超时 6:支付关闭 7:已撤销 8:转入退款) + throw new BusinessException("订单支付状态错误"); + } // 系统退款编号 $generator = $this->container->get(IdGeneratorInterface::class);