feat: add PlatformOrder isReconcileMismatch and reuse in subscription summary
This commit is contained in:
@@ -63,6 +63,15 @@ class PlatformOrder extends Model
|
||||
return $paidCents > 0 && $refundCents >= $paidCents;
|
||||
}
|
||||
|
||||
public function isReconcileMismatch(): bool
|
||||
{
|
||||
// 口径与平台订单列表 reconcile_mismatch 保持一致:支付回执总额 与订单 paid_amount 不一致(按分取整,差额>=0.01)
|
||||
$receiptCents = (int) round(((float) $this->receiptTotal()) * 100);
|
||||
$paidCents = (int) round(((float) ($this->paid_amount ?? 0)) * 100);
|
||||
|
||||
return abs($receiptCents - $paidCents) >= 1;
|
||||
}
|
||||
|
||||
protected $fillable = [
|
||||
'merchant_id', 'plan_id', 'site_subscription_id', 'created_by_admin_id', 'order_no', 'order_type', 'status',
|
||||
'payment_status', 'payment_channel', 'plan_name', 'billing_cycle', 'period_months', 'quantity', 'list_amount',
|
||||
|
||||
Reference in New Issue
Block a user