Browse Source

update: fix code support php8

tokumeikoi 3 years ago
parent
commit
0f0f726269
1 changed files with 3 additions and 3 deletions
  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('更新完毕');
     }