Browse Source

chore: code clean up

Cat 3 years ago
parent
commit
c47806aacb

+ 0 - 1
db/migrations/20000101000000_init_database.php.new

@@ -367,7 +367,6 @@ final class InitDatabase extends AbstractMigration
         $this->table('paylist')->drop()->update();
         $this->table('shop')->drop()->update();
         $this->table('user_invite_code')->drop()->update();
-        $this->table('node_info')->drop()->update();
         $this->table('node_online_log')->drop()->update();
         $this->table('user_password_reset')->drop()->update();
         $this->table('telegram_session')->drop()->update();

+ 1 - 1
src/Command/Backup.php

@@ -53,7 +53,7 @@ EOL;
                 $ret
             );
             system(
-                'mysqldump --opt --user=' . $_ENV['db_username'] . ' --password=' . $_ENV['db_password'] . ' --host=' . $db_address_array[0] . ' ' . (isset($db_address_array[1]) ? '-P ' . $db_address_array[1] : '') . ' -d ' . $_ENV['db_database'] . ' alive_ip node_info node_online_log detect_log telegram_session >> /tmp/ssmodbackup/mod.sql',
+                'mysqldump --opt --user=' . $_ENV['db_username'] . ' --password=' . $_ENV['db_password'] . ' --host=' . $db_address_array[0] . ' ' . (isset($db_address_array[1]) ? '-P ' . $db_address_array[1] : '') . ' -d ' . $_ENV['db_database'] . ' alive_ip node_online_log detect_log telegram_session >> /tmp/ssmodbackup/mod.sql',
                 $ret
             );
         }

+ 0 - 1
src/Command/Job.php

@@ -109,7 +109,6 @@ EOL;
         // ------- 重置自增 ID
         $db = new DatatablesHelper();
         Tools::resetAutoIncrement($db, 'node_online_log');
-        Tools::resetAutoIncrement($db, 'node_info');
         // ------- 重置自增 ID
 
         // ------- 用户流量重置

+ 0 - 24
src/Models/NodeInfoLog.php

@@ -1,24 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace App\Models;
-
-final class NodeInfoLog extends Model
-{
-    protected $connection = 'default';
-    protected $table = 'node_info';
-
-    public function getNodeLoad()
-    {
-        $load = $this->attributes['load'];
-        $exp = explode(' ', $load);
-        return $exp[0];
-    }
-
-    public function getTime()
-    {
-        $time = $this->attributes['log_time'];
-        return date('Y-m-d H:i:s', $time);
-    }
-}