NodeInfoLog.php 450 B

123456789101112131415161718192021222324
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Models;
  4. class NodeInfoLog extends Model
  5. {
  6. protected $connection = 'default';
  7. protected $table = 'node_info';
  8. public function getNodeLoad()
  9. {
  10. $load = $this->attributes['load'];
  11. $exp = explode(' ', $load);
  12. return $exp[0];
  13. }
  14. public function getTime()
  15. {
  16. $time = $this->attributes['log_time'];
  17. return date('Y-m-d H:i:s', $time);
  18. }
  19. }