fix: 完善取消退款恢复与师傅端流程
这个提交包含在:
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
namespace app\common\library;
|
||||
|
||||
class CancelRefundSummary
|
||||
{
|
||||
public static function summarize(array $rows)
|
||||
{
|
||||
$amount = 0.0;
|
||||
$state = $rows ? 'success' : 'missing';
|
||||
foreach ($rows as $row) {
|
||||
$amount += (float)$row['refund_amount'];
|
||||
if ($row['status'] === 'refund_failed') {
|
||||
$state = 'failed';
|
||||
} elseif ($row['status'] !== 'refunded' && $state !== 'failed') {
|
||||
$state = 'processing';
|
||||
}
|
||||
}
|
||||
return ['state' => $state, 'amount' => round($amount, 2)];
|
||||
}
|
||||
}
|
||||
在新工单中引用
屏蔽一个用户