diff --git a/app/Console/Commands/BackupDatabase.php b/app/Console/Commands/BackupDatabase.php index 22a3c3c..377a6e6 100644 --- a/app/Console/Commands/BackupDatabase.php +++ b/app/Console/Commands/BackupDatabase.php @@ -26,9 +26,10 @@ class BackupDatabase extends Command } // 数据库备份逻辑 + $databaseBackupPath = storage_path('backup/' . now()->format('Y-m-d_H-i-s') . '_' . config('database.connections.mysql.database') . '_database_backup.sql'); + $compressedBackupPath = $databaseBackupPath . '.gz'; try{ if (config('database.default') === 'mysql'){ - $databaseBackupPath = storage_path('backup/' . now()->format('Y-m-d_H-i-s') . '_' . config('database.connections.mysql.database') . '_database_backup.sql'); $this->info("1️⃣:开始备份Mysql"); \Spatie\DbDumper\Databases\MySql::create() ->setHost(config('database.connections.mysql.host')) @@ -83,7 +84,7 @@ class BackupDatabase extends Command $bucket->upload(fopen($compressedBackupPath, 'r'), [ 'name' => $objectName, ]); - + // 输出文件链接 \Log::channel('backup')->info("🎉:数据库备份已上传到 Google Cloud Storage: $objectName"); $this->info("🎉:数据库备份已上传到 Google Cloud Storage: $objectName"); diff --git a/app/Payments/StripeALLInOne.php b/app/Payments/StripeALLInOne.php index b997c81..2847beb 100644 --- a/app/Payments/StripeALLInOne.php +++ b/app/Payments/StripeALLInOne.php @@ -48,7 +48,7 @@ class StripeALLInOne { $currency = $this->config['currency']; $exchange = $this->exchange('CNY', strtoupper($currency)); if (!$exchange) { - throw new ApiException(__('Currency conversion has timed out, please try again later')); + throw new ApiException('Currency conversion has timed out, please try again later', 500); } $stripe = new \Stripe\StripeClient($this->config['stripe_sk_live']);