Jelajahi Sumber

update: fix code support php8

tokumeikoi 3 tahun lalu
induk
melakukan
0f0f726269
1 mengubah file dengan 3 tambahan dan 3 penghapusan
  1. 3 3
      app/Console/Commands/V2boardUpdate.php

+ 3 - 3
app/Console/Commands/V2boardUpdate.php

@@ -50,11 +50,11 @@ class V2boardUpdate extends Command
             abort(500, '数据库文件格式有误');
         }
         $this->info('正在导入数据库请稍等...');
-        foreach ($sql as $item) {
-            try {
+        try {
+            foreach ($sql as $item) {
                 DB::select(DB::raw($item));
-            } catch (\Exception $e) {
             }
+        } catch (\Exception $e) {
         }
         $this->info('更新完毕');
     }