改进 统计

This commit is contained in:
iVampireSP.com 2022-11-19 13:14:51 +08:00
parent aa0dd7582d
commit ef3b393712
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132
3 changed files with 10 additions and 12 deletions

View File

@ -55,8 +55,8 @@ public function handle()
$total_should = 0;
foreach ($months as $month => $m) {
$total += $m['balance'];
$total_should += $m['should_balance'];
$total += round($m['balance'], 2);
$total_should += round($m['should_balance'], 2);
$this->info("{$module->name} {$year}{$month}月 实收: {$total}元 应得: {$total_should}");
}
}

View File

@ -275,17 +275,15 @@ public function addLog($type = 'drops', float $amount = 0)
if ($type == 'drops') {
// 换成 余额
// 如果小于 0.00,则不四舍五入
// $c = $amount / $rate;
//
// if ($c > 0.01) {
// $amount = $amount / $rate;
// }
$amount = $amount / $rate;
}
$amount = round($amount, 2);
// $amount = round($amount, 2);
// Log::debug('addLog', [
// 'amount' => $amount,
// 'rate' => $rate,
// 'commission' => $commission,
// ]);
$should_amount = round($amount * $commission, 2);

View File

@ -49,8 +49,8 @@ public function toGroup($notifiable)
$total_should = 0;
foreach ($months as $month => $m) {
$total += $m['balance'];
$total_should += $m['should_balance'];
$total += round($m['balance'], 2);
$total_should += round($m['should_balance'], 2);
$text .= <<<EOF
==========