|
@@ -81,6 +81,24 @@ class AdminBonusLogTest extends TestCase
|
|
|
$this->assertSame(2,$this->records(['is_fancai'=>1,'change_type'=>'余额宝利息'])['total']);
|
|
$this->assertSame(2,$this->records(['is_fancai'=>1,'change_type'=>'余额宝利息'])['total']);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public function test_rebate_and_backflow_grants_are_bonus_types(): void
|
|
|
|
|
+ {
|
|
|
|
|
+ DB::table('balance_logs')->insert([
|
|
|
|
|
+ ['id'=>20,'member_id'=>'m1','type'=>1,'change_type'=>'笔笔返','amount'=>'12','created_at'=>'2026-11-05 12:00:00'],
|
|
|
|
|
+ ['id'=>21,'member_id'=>'m1','type'=>1,'change_type'=>'回水','amount'=>'30','created_at'=>'2026-11-05 12:00:00'],
|
|
|
|
|
+ ]);
|
|
|
|
|
+ $all = $this->records(['is_fancai'=>1]);
|
|
|
|
|
+ $this->assertContains('笔笔返', $all['change_types']);
|
|
|
|
|
+ $this->assertContains('回水', $all['change_types']);
|
|
|
|
|
+ $this->assertSame(7, $all['total']);
|
|
|
|
|
+ foreach (['笔笔返' => [20, '12.00'], '回水' => [21, '30.00']] as $type => [$id, $sum]) {
|
|
|
|
|
+ $data = $this->records(['is_fancai'=>1, 'change_type'=>$type]);
|
|
|
|
|
+ $this->assertSame([$id], array_column($data['data'], 'id'));
|
|
|
|
|
+ $this->assertSame($sum, $data['total_amount']);
|
|
|
|
|
+ $this->assertSame($type, $data['data'][0]['change_type']);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public function test_regular_balance_type_filter_remains_effective(): void
|
|
public function test_regular_balance_type_filter_remains_effective(): void
|
|
|
{
|
|
{
|
|
|
$this->assertSame(2,$this->records(['type'=>2])['total']);
|
|
$this->assertSame(2,$this->records(['type'=>2])['total']);
|
|
@@ -110,6 +128,8 @@ class AdminBonusLogTest extends TestCase
|
|
|
$this->log(103, '老用户回归');
|
|
$this->log(103, '老用户回归');
|
|
|
$this->log(104, '注册赠送');
|
|
$this->log(104, '注册赠送');
|
|
|
$this->log(105, '充值返现');
|
|
$this->log(105, '充值返现');
|
|
|
|
|
+ $this->log(106, '笔笔返');
|
|
|
|
|
+ $this->log(107, '回水');
|
|
|
// Unclaimed/coupon rewards and zero-valued channel rewards have no credited log.
|
|
// Unclaimed/coupon rewards and zero-valued channel rewards have no credited log.
|
|
|
DB::table('promotion_rewards')->insert(['activity_id'=>9,'credited_log_id'=>null]);
|
|
DB::table('promotion_rewards')->insert(['activity_id'=>9,'credited_log_id'=>null]);
|
|
|
DB::table('recharge_bonus_rewards')->insert(['credited_log_id'=>null]);
|
|
DB::table('recharge_bonus_rewards')->insert(['credited_log_id'=>null]);
|