改进 提成设置
This commit is contained in:
parent
ec2cd375e5
commit
3b88d70fbc
@ -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
|
||||||
|
|
||||||
==========
|
==========
|
||||||
|
@ -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);
|
||||||
|
|
||||||
// 应得的余额
|
// 应得的余额
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
return [
|
|
||||||
// 提成
|
|
||||||
'commission' => 0.1,
|
|
||||||
];
|
|
@ -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', ''),
|
||||||
|
Loading…
Reference in New Issue
Block a user