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; // 订单合集