From 57ea42ffb8e1ecfaf2e0b0386c3c138b8722b8d0 Mon Sep 17 00:00:00 2001 From: yueyang Date: Tue, 29 Sep 2026 18:04:31 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=91=E7=9B=AE=E6=98=A0=E5=B0=84=E8=A1=A8?= =?UTF-8?q?=EF=BC=9A=E5=AF=BC=E5=87=BA=E6=96=87=E4=BB=B6=E5=90=8D=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E6=88=B3=E4=B9=9F=E6=8C=89=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E6=97=B6=E5=8C=BA=EF=BC=88=E5=8C=97=E4=BA=AC=E6=97=B6=E9=97=B4?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Business/AccountMappingActions.php | 2 +- modules/EcommerceFinance/Services/AccountMappingStore.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/Business/AccountMappingActions.php b/app/Http/Controllers/Business/AccountMappingActions.php index e37d314c..9e6618c4 100644 --- a/app/Http/Controllers/Business/AccountMappingActions.php +++ b/app/Http/Controllers/Business/AccountMappingActions.php @@ -343,7 +343,7 @@ class AccountMappingActions extends Controller fputcsv($csv, $row); } fclose($csv); - }, '科目映射表_' . now()->format('Ymd_His') . '.csv', [ + }, '科目映射表_' . $this->store->platformNow()->format('Ymd_His') . '.csv', [ 'Content-Type' => 'text/csv; charset=UTF-8', 'Cache-Control' => 'private, no-store', ]); diff --git a/modules/EcommerceFinance/Services/AccountMappingStore.php b/modules/EcommerceFinance/Services/AccountMappingStore.php index 4f49b0e6..1b1a3aea 100644 --- a/modules/EcommerceFinance/Services/AccountMappingStore.php +++ b/modules/EcommerceFinance/Services/AccountMappingStore.php @@ -362,11 +362,11 @@ class AccountMappingStore } /** - * 记录时间用的“现在”:固定按平台时区,不受页面请求里公司设置覆盖的影响。 + * 本模块统一用的“现在”:固定按平台时区,不受页面请求里公司设置覆盖的影响。 * * 直接用 now() 的话,页面操作写进日志的时间会差 7 小时(Europe/London)。 */ - private function logNow(): Carbon + public function platformNow(): Carbon { $timezone = trim((string) config('app.platform_timezone', '')); @@ -404,7 +404,7 @@ class AccountMappingStore } $json = json_encode( - ['updated_at' => $this->logNow()->toDateTimeString(), 'rules' => array_values($rules)], + ['updated_at' => $this->platformNow()->toDateTimeString(), 'rules' => array_values($rules)], JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT ); @@ -421,7 +421,7 @@ class AccountMappingStore $events = is_array($payload['events'] ?? null) ? $payload['events'] : []; $events[] = array_merge([ - 'at' => $this->logNow()->toDateTimeString(), + 'at' => $this->platformNow()->toDateTimeString(), 'action' => $action, 'id' => $id, 'before' => $before,