feat(admin): 线索创建订单链接支持预填站点 merchant_id

This commit is contained in:
萝卜
2026-03-14 03:36:38 +00:00
parent 23ff6d7d5d
commit b5688d8866
2 changed files with 91 additions and 0 deletions

View File

@@ -14,6 +14,7 @@
}
// 从线索直达“创建平台订单”入口:预填 plan_id/remark并带 back 回到当前线索列表(保留筛选)
// 备注:如果线索 meta 中包含 merchant_id也会一并预填用于“已存在站点但需补单/续费”的场景)
$buildCreatePlatformOrderUrl = function (\App\Models\PlatformLead $l) use ($selfWithoutBack) {
$remarkParts = array_filter([
'线索#' . $l->id,
@@ -33,6 +34,12 @@
$q['plan_id'] = (int) $l->plan_id;
}
$meta = is_array($l->meta) ? $l->meta : [];
$merchantId = (int) ($meta['merchant_id'] ?? 0);
if ($merchantId > 0) {
$q['merchant_id'] = $merchantId;
}
return '/admin/platform-orders/create?' . \Illuminate\Support\Arr::query($q);
};
@endphp