fix: 退款镜像显示最近成功时间 #900
@ -177,7 +177,7 @@ class NonJingxiRefundMirrorRepository
|
||||
$lastSucceededAt = collect($states)
|
||||
->pluck('last_succeeded_at')
|
||||
->filter()
|
||||
->sort()
|
||||
->sortDesc()
|
||||
->first();
|
||||
|
||||
if (! $initialized) {
|
||||
|
||||
@ -122,6 +122,24 @@ class NonJingxiRefundMirrorRepositoryTest extends TestCase
|
||||
$this->assertSame('initializing', $this->repository->syncStatus($states)['code']);
|
||||
}
|
||||
|
||||
public function test_sync_status_uses_the_most_recent_successful_mirror_refresh(): void
|
||||
{
|
||||
$states = $this->repository->states();
|
||||
foreach ($states as &$state) {
|
||||
$state['last_succeeded_at'] = '2026-08-21 06:10:00';
|
||||
}
|
||||
unset($state);
|
||||
$states[NonJingxiRefundMirrorRepository::STATUS_DATASET]['last_succeeded_at'] = '2026-08-21 12:29:00';
|
||||
|
||||
$status = $this->repository->syncStatus(
|
||||
$states,
|
||||
Carbon::parse('2026-08-21 12:30:00'),
|
||||
);
|
||||
|
||||
$this->assertSame('healthy', $status['code']);
|
||||
$this->assertSame('2026-08-21 12:29:00', $status['last_succeeded_at']);
|
||||
}
|
||||
|
||||
public function test_pending_confirmation_requires_the_current_status_mirror(): void
|
||||
{
|
||||
DB::connection('business_mirror')->table('business_mirror_table_states')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user