feat(billing): 平台订单创建页展示订阅关联提示并加测试

This commit is contained in:
萝卜
2026-03-11 03:17:58 +00:00
parent 83de69c081
commit 7707bf6a03
3 changed files with 58 additions and 0 deletions

View File

@@ -7,6 +7,7 @@ use App\Http\Controllers\Controller;
use App\Models\Merchant;
use App\Models\Plan;
use App\Models\PlatformOrder;
use App\Models\SiteSubscription;
use App\Support\SubscriptionActivationService;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Http\RedirectResponse;
@@ -39,9 +40,16 @@ class PlatformOrderController extends Controller
'remark' => (string) $request->query('remark', ''),
];
$siteSubscription = null;
$siteSubscriptionId = (int) ($defaults['site_subscription_id'] ?? 0);
if ($siteSubscriptionId > 0) {
$siteSubscription = SiteSubscription::query()->with(['merchant', 'plan'])->find($siteSubscriptionId);
}
return view('admin.platform_orders.form', [
'merchants' => $merchants,
'plans' => $plans,
'siteSubscription' => $siteSubscription,
'billingCycleLabels' => $this->billingCycleLabels(),
'orderTypeLabels' => $this->orderTypeLabels(),
'defaults' => $defaults,