订阅详情已付无回执链接收紧到收费治理口径
This commit is contained in:
@@ -261,8 +261,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="muted muted-xs">点击订单数可跳转:该订阅下「有回执」订单</div>
|
<div class="muted muted-xs">点击订单数可跳转:该订阅下「有回执」订单</div>
|
||||||
<div class="muted muted-xs">
|
<div class="muted muted-xs">
|
||||||
无回执订单:
|
已付无回执订单:
|
||||||
<a class="link" href="{!! $makePlatformOrderUrl(['site_subscription_id' => $subscription->id, 'receipt_status' => 'none']) !!}">{{ $summaryStats['no_receipt_orders'] ?? 0 }}</a>
|
<a class="link" href="{!! $makePlatformOrderUrl(['site_subscription_id' => $subscription->id, 'payment_status' => 'paid', 'receipt_status' => 'none']) !!}">{{ $summaryStats['no_receipt_orders'] ?? 0 }}</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,62 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\Feature;
|
||||||
|
|
||||||
|
use App\Models\Merchant;
|
||||||
|
use App\Models\Plan;
|
||||||
|
use App\Models\SiteSubscription;
|
||||||
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
class AdminSiteSubscriptionShowNoReceiptOrdersLinkShouldPointToPaidNoReceiptScopeTest extends TestCase
|
||||||
|
{
|
||||||
|
use RefreshDatabase;
|
||||||
|
|
||||||
|
protected function loginAsPlatformAdmin(): void
|
||||||
|
{
|
||||||
|
$this->seed();
|
||||||
|
|
||||||
|
$this->post('/admin/login', [
|
||||||
|
'email' => 'platform.admin@demo.local',
|
||||||
|
'password' => 'Platform@123456',
|
||||||
|
])->assertRedirect('/admin');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function test_show_should_point_no_receipt_orders_link_to_paid_no_receipt_scope(): void
|
||||||
|
{
|
||||||
|
$this->loginAsPlatformAdmin();
|
||||||
|
|
||||||
|
$merchant = Merchant::query()->firstOrFail();
|
||||||
|
$plan = Plan::query()->create([
|
||||||
|
'code' => 'sub_show_paid_no_receipt_scope_plan',
|
||||||
|
'name' => '订阅详情已付无回执口径测试套餐',
|
||||||
|
'billing_cycle' => 'monthly',
|
||||||
|
'price' => 66,
|
||||||
|
'list_price' => 66,
|
||||||
|
'status' => 'active',
|
||||||
|
'sort' => 10,
|
||||||
|
'published_at' => now(),
|
||||||
|
]);
|
||||||
|
|
||||||
|
$subscription = SiteSubscription::query()->create([
|
||||||
|
'merchant_id' => $merchant->id,
|
||||||
|
'plan_id' => $plan->id,
|
||||||
|
'status' => 'active',
|
||||||
|
'source' => 'manual',
|
||||||
|
'subscription_no' => 'SS_SHOW_PNR_SCOPE_0001',
|
||||||
|
'plan_name' => $plan->name,
|
||||||
|
'billing_cycle' => $plan->billing_cycle,
|
||||||
|
'period_months' => 1,
|
||||||
|
'amount' => 66,
|
||||||
|
'starts_at' => now()->subDay(),
|
||||||
|
'ends_at' => now()->addMonth(),
|
||||||
|
]);
|
||||||
|
|
||||||
|
$res = $this->get('/admin/site-subscriptions/' . $subscription->id);
|
||||||
|
$res->assertOk();
|
||||||
|
|
||||||
|
$html = (string) $res->getContent();
|
||||||
|
$this->assertStringContainsString('已付无回执订单:', $html);
|
||||||
|
$this->assertStringContainsString('/admin/platform-orders?site_subscription_id=' . $subscription->id . '&payment_status=paid&receipt_status=none&back=' . urlencode('/admin/site-subscriptions/' . $subscription->id), $html);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user