NodeInfoLog.php 434 B

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