Speedtest.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. namespace App\Models;
  3. /**
  4. * Node Model
  5. */
  6. use App\Utils\Tools;
  7. class Speedtest extends Model
  8. {
  9. protected $connection = "default";
  10. protected $table = "speedtest";
  11. public function node()
  12. {
  13. return Node::find($this->attributes['nodeid']);
  14. }
  15. public function getTelecomPing()
  16. {
  17. $load = $this->attributes['telecomping'];
  18. $exp = explode(" ", $load);
  19. return $exp[0];
  20. }
  21. public function getUnicomPing()
  22. {
  23. $load = $this->attributes['unicomping'];
  24. $exp = explode(" ", $load);
  25. return $exp[0];
  26. }
  27. public function getCmccPing()
  28. {
  29. $load = $this->attributes['cmccping'];
  30. $exp = explode(" ", $load);
  31. return $exp[0];
  32. }
  33. public function getTelecomUpload()
  34. {
  35. $load = $this->attributes['telecomeupload'];
  36. $exp = explode(" ", $load);
  37. return $exp[0];
  38. }
  39. public function getTelecomDownload()
  40. {
  41. $load = $this->attributes['telecomedownload'];
  42. $exp = explode(" ", $load);
  43. return $exp[0];
  44. }
  45. public function getUnicomUpload()
  46. {
  47. $load = $this->attributes['unicomupload'];
  48. $exp = explode(" ", $load);
  49. return $exp[0];
  50. }
  51. public function getUnicomDownload()
  52. {
  53. $load = $this->attributes['unicomdownload'];
  54. $exp = explode(" ", $load);
  55. return $exp[0];
  56. }
  57. public function getCmccDownload()
  58. {
  59. $load = $this->attributes['cmccdownload'];
  60. $exp = explode(" ", $load);
  61. return $exp[0];
  62. }
  63. public function getCmccUpload()
  64. {
  65. $load = $this->attributes['cmccupload'];
  66. $exp = explode(" ", $load);
  67. return $exp[0];
  68. }
  69. }