diff --git a/modules/EcommerceFinance/Repositories/SupplierPayableReportRepository.php b/modules/EcommerceFinance/Repositories/SupplierPayableReportRepository.php index 8b894361..910b64a1 100644 --- a/modules/EcommerceFinance/Repositories/SupplierPayableReportRepository.php +++ b/modules/EcommerceFinance/Repositories/SupplierPayableReportRepository.php @@ -99,7 +99,7 @@ class SupplierPayableReportRepository * 按月份读取供应商应付表最晚出账时间(上游 modifiedTime)。 * * @param list $months - * @return list + * @return list */ public function latestModifiedTimes(array $months): array { @@ -115,19 +115,15 @@ class SupplierPayableReportRepository $sql = 'SELECT ' . '[Month] AS month, ' . '[supplier] AS supplier, ' - . '[checker] AS checker, ' - . '[settleway] AS settlement_method, ' . 'CONVERT(varchar(19), MAX([modifiedTime]), 120) AS modified_at ' . 'FROM [dbo].[fys_supplierPaymentSummary] ' . "WHERE [Month] IN ({$placeholders}) " - . 'GROUP BY [Month], [supplier], [checker], [settleway]'; + . 'GROUP BY [Month], [supplier]'; return array_map( static fn (array $row): array => [ 'month' => trim((string) ($row['month'] ?? '')), 'supplier' => trim((string) ($row['supplier'] ?? '')), - 'checker' => trim((string) ($row['checker'] ?? '')), - 'settlement_method' => trim((string) ($row['settlement_method'] ?? '')), 'modified_at' => trim((string) ($row['modified_at'] ?? '')), ], $this->query->select($sql, $months), diff --git a/modules/EcommerceFinance/View/SupplierNegativeAlertPageData.php b/modules/EcommerceFinance/View/SupplierNegativeAlertPageData.php index ce1a4973..8eb2abd7 100644 --- a/modules/EcommerceFinance/View/SupplierNegativeAlertPageData.php +++ b/modules/EcommerceFinance/View/SupplierNegativeAlertPageData.php @@ -297,8 +297,6 @@ class SupplierNegativeAlertPageData return implode("\0", [ trim((string) ($row['summary_month'] ?? $row['month'] ?? '')), trim((string) ($row['supplier'] ?? '')), - trim((string) ($row['checker'] ?? '')), - trim((string) ($row['settlement_method'] ?? '')), ]); } diff --git a/tests/Feature/Business/NegativeAlertPagesTest.php b/tests/Feature/Business/NegativeAlertPagesTest.php index f2980f27..c408dca9 100644 --- a/tests/Feature/Business/NegativeAlertPagesTest.php +++ b/tests/Feature/Business/NegativeAlertPagesTest.php @@ -82,15 +82,15 @@ class NegativeAlertPagesTest extends FeatureTestCase [ 'month' => '2026-09', 'supplier' => '负余额供应商', - 'checker' => '', - 'settlement_method' => '', + 'checker' => '上游原对账人', + 'settlement_method' => '上游原结算方式', 'modified_at' => '2026-11-09 09:30:00', ], [ 'month' => '2026-09', 'supplier' => '公式命中供应商', - 'checker' => '', - 'settlement_method' => '', + 'checker' => '上游原对账人', + 'settlement_method' => '上游原结算方式', 'modified_at' => '2026-11-09 10:15:00', ], ]); diff --git a/tests/Unit/EcommerceFinance/SupplierPayableReportRepositoryTest.php b/tests/Unit/EcommerceFinance/SupplierPayableReportRepositoryTest.php index f1910009..35bd507e 100644 --- a/tests/Unit/EcommerceFinance/SupplierPayableReportRepositoryTest.php +++ b/tests/Unit/EcommerceFinance/SupplierPayableReportRepositoryTest.php @@ -81,7 +81,7 @@ class SupplierPayableReportRepositoryTest extends TestCase $this->assertTrue($result['rows'][0]['is_payment']); } - public function test_latest_modified_times_are_grouped_by_month_supplier_checker_and_settlement(): void + public function test_latest_modified_times_are_grouped_by_month_and_supplier(): void { $query = $this->createMock(UpstreamReadOnlyQuery::class); $query->expects($this->once())->method('select')->willReturnCallback( @@ -89,14 +89,12 @@ class SupplierPayableReportRepositoryTest extends TestCase UpstreamReadOnlyQuery::assertReadOnlySql($sql); $this->assertStringContainsString('[dbo].[fys_supplierPaymentSummary]', $sql); $this->assertStringContainsString('MAX([modifiedTime])', $sql); - $this->assertStringContainsString('[settleway] AS settlement_method', $sql); + $this->assertStringContainsString('GROUP BY [Month], [supplier]', $sql); $this->assertSame(['2026-09', '2026-10'], $bindings); return [[ 'month' => '2026-09', 'supplier' => '供应商甲', - 'checker' => '陈亲园', - 'settlement_method' => '月结', 'modified_at' => '2026-11-09 09:30:00', ]]; }, @@ -111,8 +109,6 @@ class SupplierPayableReportRepositoryTest extends TestCase $this->assertSame('2026-09', $result[0]['month']); $this->assertSame('供应商甲', $result[0]['supplier']); - $this->assertSame('陈亲园', $result[0]['checker']); - $this->assertSame('月结', $result[0]['settlement_method']); $this->assertSame('2026-11-09 09:30:00', $result[0]['modified_at']); }