改进 提成设置

This commit is contained in:
iVampireSP.com 2023-02-04 01:46:07 +08:00
parent ec2cd375e5
commit 3b88d70fbc
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132
4 changed files with 8 additions and 9 deletions

View File

@ -53,8 +53,10 @@ private function send(Module $module): void
$total_should = 0; $total_should = 0;
foreach ($months as $month => $m) { foreach ($months as $month => $m) {
$total += round($m['balance'], 2); // bc 保留两位小数
$total_should += round($m['should_balance'], 2); $total = bcadd($total, $m['balance'], 2);
$total_should = bcadd($total_should, $m['should_balance'], 2);
$text .= <<<EOF $text .= <<<EOF
========== ==========

View File

@ -280,7 +280,7 @@ public function addLog(string $amount = '0'): bool
$cache_key = 'module_earning_'.$this->module_id; $cache_key = 'module_earning_'.$this->module_id;
// 应支付的提成 // 应支付的提成
$commission = config('billing.commission'); $commission = config('settings.billing.commission');
$should_amount = bcmul($amount, $commission, 4); $should_amount = bcmul($amount, $commission, 4);
// 应得的余额 // 应得的余额

View File

@ -1,6 +0,0 @@
<?php
return [
// 提成
'commission' => 0.1,
];

View File

@ -1,6 +1,9 @@
<?php <?php
return [ return [
'billing' => [
'commission' => '0.1',
],
'wecom' => [ 'wecom' => [
'robot_hook' => [ 'robot_hook' => [
'default' => env('WECOM_ROBOT_HOOK_DEFAULT', ''), 'default' => env('WECOM_ROBOT_HOOK_DEFAULT', ''),