|
|
@@ -718,11 +718,29 @@ class ReportingTest extends TestCase
|
|
|
$this->assertNotContains('unallocated', array_column($details['data'], 'group_id'));
|
|
|
$this->assertSame(2, $details['total']);
|
|
|
}
|
|
|
+ $this->assertSame('2.0000000000', $this->reader->summary($this->today())['commission_balances']['agent_unpaid']);
|
|
|
$this->assertSame('7.0000000000', $this->reader->summary($this->today())['summary']['agent_commission']);
|
|
|
$this->assertSame('28.0000000000', $this->reader->summary($this->today())['summary']['company_profit']);
|
|
|
$this->assertSame('5.0000000000', $this->reader->summary(['report_type' => 'sharing'])['summary']['share_commission']);
|
|
|
}
|
|
|
|
|
|
+ public function test_business_summary_survives_rebate_records_without_flow_columns(): void
|
|
|
+ {
|
|
|
+ DB::table('agent_rebate_records')->insert(['id' => 1, 'agent_id' => 10, 'platform' => 'self:lottery', 'game_type' => 8,
|
|
|
+ 'settlement_date' => '2026-10-26', 'profit_commission' => '4.5', 'profit_status' => 'pending', 'created_at' => '2026-10-26 10:00:00']);
|
|
|
+ DB::statement('ALTER TABLE bot_agent_rebate_records DROP COLUMN flow_commission');
|
|
|
+ DB::statement('ALTER TABLE bot_agent_rebate_records DROP COLUMN flow_status');
|
|
|
+ set_error_handler(static function (int $severity, string $message): bool {
|
|
|
+ throw new \ErrorException($message, 0, $severity);
|
|
|
+ });
|
|
|
+ try {
|
|
|
+ $balances = $this->reader->summary([])['commission_balances'];
|
|
|
+ } finally {
|
|
|
+ restore_error_handler();
|
|
|
+ }
|
|
|
+ $this->assertSame('4.5000000000', $balances['agent_unpaid']);
|
|
|
+ }
|
|
|
+
|
|
|
public function test_daily_total_is_for_all_pages_and_source_errors_are_visible_until_fixed(): void
|
|
|
{
|
|
|
$this->bet(1, ['created_at' => '2026-10-25 09:00:00']);
|