|
|
@@ -5,6 +5,7 @@ namespace App\Module\Transfer\Events;
|
|
|
use App\Module\Transfer\Models\TransferApp;
|
|
|
use Illuminate\Foundation\Events\Dispatchable;
|
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
+use UCore\Helper\Logger;
|
|
|
|
|
|
/**
|
|
|
* 手续费计算完成事件
|
|
|
@@ -121,6 +122,7 @@ class FeeCalculatedEvent
|
|
|
*/
|
|
|
public static function fromCalculatingEvent(FeeCalculatingEvent $calculatingEvent): static
|
|
|
{
|
|
|
+ Logger::debug('fromCalculatingEvent'." {$calculatingEvent->amount}, {$calculatingEvent->feeAmount}");
|
|
|
if ($calculatingEvent->type == 'in') {
|
|
|
// 转入
|
|
|
$actualAmount = bcsub($calculatingEvent->amount, $calculatingEvent->feeAmount, 10);
|
|
|
@@ -131,10 +133,11 @@ class FeeCalculatedEvent
|
|
|
$totleAmout = bcadd($calculatingEvent->amount, $calculatingEvent->feeAmount, 10);
|
|
|
}
|
|
|
if($calculatingEvent->feeAmount > 0){
|
|
|
- $feeRate = bcdiv($calculatingEvent->amount, $calculatingEvent->feeAmount, 10);
|
|
|
+ $feeRate = bcdiv($calculatingEvent->feeAmount * 100,$calculatingEvent->amount, 4) ;
|
|
|
}else{
|
|
|
$feeRate = 0;
|
|
|
}
|
|
|
+ Logger::debug('fromCalculatingEvent feerate'." {$calculatingEvent->amount}, {$calculatingEvent->feeAmount} ,$feeRate");
|
|
|
|
|
|
return new static(
|
|
|
app: $calculatingEvent->app,
|