refactor(platform-orders): centralize export ledger url builder
This commit is contained in:
@@ -50,6 +50,15 @@ class PlatformOrder extends Model
|
||||
|| (data_get($this->meta, 'refund_receipts.0.amount') !== null);
|
||||
}
|
||||
|
||||
public function exportLedgerUrl(array $query = []): string
|
||||
{
|
||||
// 安全阀:download=1 必须显式存在(用于防止预取/误触发)。
|
||||
// 且为了测试/口径稳定,download 固定在 query 的第一位。
|
||||
$query = ['download' => 1] + $query;
|
||||
|
||||
return '/admin/platform-orders/' . $this->id . '/export-ledger?' . \Illuminate\Support\Arr::query($query);
|
||||
}
|
||||
|
||||
public function refundTotal(): float
|
||||
{
|
||||
// 优先读扁平字段 refund_summary.total_amount
|
||||
|
||||
Reference in New Issue
Block a user