From 762b3f46133fbe0c9e4cd2cacd67a13014264f10 Mon Sep 17 00:00:00 2001 From: wucongxing <815046773@qq.com> Date: Mon, 11 Dec 2023 15:56:09 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=88=91=E7=9A=84=E8=B4=A6?= =?UTF-8?q?=E6=88=B7=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Model/DoctorAccountDay.php | 1 + app/Services/DoctorAccountService.php | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/Model/DoctorAccountDay.php b/app/Model/DoctorAccountDay.php index 39c0ad0..9e406cf 100644 --- a/app/Model/DoctorAccountDay.php +++ b/app/Model/DoctorAccountDay.php @@ -118,6 +118,7 @@ class DoctorAccountDay extends Model return self::select(['month',Db::raw('SUM(total_amount) AS `total_amount`')]) ->where($params) ->groupBy(['month']) + ->orderBy('month') ->get($fields); } } diff --git a/app/Services/DoctorAccountService.php b/app/Services/DoctorAccountService.php index d8190df..4d63f7c 100644 --- a/app/Services/DoctorAccountService.php +++ b/app/Services/DoctorAccountService.php @@ -246,18 +246,19 @@ class DoctorAccountService extends BaseService } } - $amount_total = $amount_total * 0.75; + $amount_total = bcmul($amount_total,0.75,2); // 计算医生个人所得税 $income_tax = $this->computeIndividualIncomeTax($amount_total); - $withdrawal_amount = floor(($amount_total - $income_tax) * 100) / 100; + $withdrawal_amount = bcsub($amount_total,$income_tax,2); - $income_tax = floor($income_tax * 100) / 100; + $income_tax = bcmul($income_tax,1,2); $result = array(); $result['bank'] = $bank;//银行数据 + $result['amount_total'] = $amount_total; // 账户余额 $result['withdrawal_amount'] = $withdrawal_amount; // 提现金额 $result['income_tax'] = $income_tax; // 个人所得税 $result['order_inquiry_ids'] = $order_inquiry_id_array; // 订单合集