feat(billing): 平台订单创建页展示订阅关联提示并加测试
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user