diff --git a/app/Http/Controllers/Business/Pages.php b/app/Http/Controllers/Business/Pages.php index 2571c78b..9599b2bf 100644 --- a/app/Http/Controllers/Business/Pages.php +++ b/app/Http/Controllers/Business/Pages.php @@ -1545,7 +1545,7 @@ class Pages extends Controller if ($platform === 'jd') { fputcsv($csv, [ - '平台', '店铺', '账户', '日期', '收支类型', '交易类型', + '平台', '店铺', '账户', '日期', '记账时间', '收支类型', '交易类型', '金额(元)', '余额(元)', '备注', ]); foreach ($data['jd'] ?? [] as $row) { @@ -1553,7 +1553,8 @@ class Pages extends Controller '京东京准通', $row['shop_name'] ?? '', $row['account'] ?? '', - $row['show_date'] ?? $row['settle_datetime'] ?? '', + $row['show_date'] ?? '', + $row['settle_datetime'] ?? '', $row['in_out_type_name'] ?? '', $row['trade_type_name'] ?? '', $row['amount'] ?? '', diff --git a/resources/views/banking/marketing_platform_promotion_bills/partials/embedded-table.blade.php b/resources/views/banking/marketing_platform_promotion_bills/partials/embedded-table.blade.php index 2fade9a7..1883b44b 100644 --- a/resources/views/banking/marketing_platform_promotion_bills/partials/embedded-table.blade.php +++ b/resources/views/banking/marketing_platform_promotion_bills/partials/embedded-table.blade.php @@ -11,7 +11,7 @@ $titles = ['jd' => '京东京准通', 'douyin' => '抖音千川', 'dewu' => '得物推广账户', 'vip' => '唯品会推广流水']; $filterLabel = $platform === 'vip' ? $titles[$platform] . '筛选' : $titles[$platform] . '推广账户筛选'; $columns = match ($platform) { - 'jd' => [['shop_name', '店铺'], ['account', '账户'], ['show_date', '日期'], ['in_out_type_name', '收支类型'], ['trade_type_name', '交易类型'], ['amount', '金额'], ['balance_amount', '余额'], ['remark', '备注']], + 'jd' => [['shop_name', '店铺'], ['account', '账户'], ['show_date', '日期'], ['settle_datetime', '记账时间'], ['in_out_type_name', '收支类型'], ['trade_type_name', '交易类型'], ['amount', '金额'], ['balance_amount', '余额'], ['remark', '备注']], 'douyin' => [['shopName', '店铺'], ['account', '账户'], ['qianchuanAavid', '广告账户'], ['statDate', '日期'], ['cost', '花费'], ['income', '收入'], ['transferIn', '转入'], ['transferOut', '转出'], ['balance', '余额'], ['status', '状态'], ['remark', '备注']], 'dewu' => [['shop_name', '店铺'], ['account', '账户'], ['trade_date', '日期'], ['amount_type', '金额类型'], ['flow_type', '收支类型'], ['trade_amount_yuan', '金额'], ['balance_yuan', '余额'], ['remark', '备注']], default => [ diff --git a/tests/Feature/Business/MarketingPlatformPromotionBillsTest.php b/tests/Feature/Business/MarketingPlatformPromotionBillsTest.php index 96a483cc..2baa89a6 100644 --- a/tests/Feature/Business/MarketingPlatformPromotionBillsTest.php +++ b/tests/Feature/Business/MarketingPlatformPromotionBillsTest.php @@ -32,6 +32,8 @@ class MarketingPlatformPromotionBillsTest extends FeatureTestCase ->assertSeeText('京东京准通') ->assertSee('aria-label="京东京准通推广账户筛选"', false) ->assertSeeText('测试店铺') + ->assertSeeText('记账时间') + ->assertSeeText('2026-08-02 09:10:57') ->assertSeeText('收支类型') ->assertSeeText('出账') ->assertSeeText('导出 CSV') @@ -78,6 +80,8 @@ class MarketingPlatformPromotionBillsTest extends FeatureTestCase $this->assertStringContainsString('测试店铺', $csv); $this->assertStringContainsString('收支类型', $csv); $this->assertStringContainsString('交易类型', $csv); + $this->assertStringContainsString('记账时间', $csv); + $this->assertStringContainsString('2026-08-02 09:10:57', $csv); $this->assertStringContainsString('出账', $csv); $this->assertStringContainsString('推广费', $csv); } @@ -202,6 +206,7 @@ class MarketingPlatformPromotionBillsTest extends FeatureTestCase 'shop_name' => '测试店铺', 'account' => 'account-01', 'show_date' => '2026-08-01', + 'settle_datetime' => '2026-08-02 09:10:57', 'in_out_type_name' => '出账', 'trade_type_name' => '推广费', 'amount' => 100, diff --git a/tests/Unit/EcommerceFinance/PlatformPromotionAccountRepositoryTest.php b/tests/Unit/EcommerceFinance/PlatformPromotionAccountRepositoryTest.php index 39f96dce..a123e6c8 100644 --- a/tests/Unit/EcommerceFinance/PlatformPromotionAccountRepositoryTest.php +++ b/tests/Unit/EcommerceFinance/PlatformPromotionAccountRepositoryTest.php @@ -22,6 +22,7 @@ class PlatformPromotionAccountRepositoryTest extends TestCase $query->shouldReceive('select')->once()->ordered()->with( Mockery::on(static fn (string $sql): bool => str_contains($sql, 'SELECT TOP 5000') && str_contains($sql, 'jd_jzt_finance_records') + && str_contains($sql, 'settle_datetime') && str_contains($sql, 'in_out_type_name')), ['2026-08'], )->andReturn([['shop_name' => '测试店铺', 'amount' => 100]]);