Console.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?php
  2. namespace Manage\Src;
  3. use Dever;
  4. class Console
  5. {
  6. # 获取控制台左侧第一个数据内容
  7. public function system()
  8. {
  9. $project = count(Dever::load('manage/project')->get());
  10. $table = count(scandir(Dever::data() . 'database/' . DEVER_PROJECT . '/')) - 2;
  11. $api = Dever::db('manage/api')->total();
  12. $log = Dever::db('manage/log')->total();
  13. $manage = Dever::db('manage/admin')->total();
  14. $sql = Dever::db('manage/opt')->total();
  15. $opt = Dever::db('manage/opt')->total(array('status' => 2));
  16. $cron = Dever::db('manage/cron')->total();
  17. $data[] = array
  18. (
  19. 'name' => '组件数',
  20. 'num' => $project,
  21. 'href' => '#',
  22. );
  23. $data[] = array
  24. (
  25. 'name' => '数据表',
  26. 'num' => $table,
  27. 'href' => '#',
  28. );
  29. $data[] = array
  30. (
  31. 'name' => '接口数',
  32. 'num' => $api,
  33. 'href' => '#',
  34. );
  35. $data[] = array
  36. (
  37. 'name' => '日志数',
  38. 'num' => $log,
  39. 'href' => '#',
  40. );
  41. $data[] = array
  42. (
  43. 'name' => '管理员',
  44. 'num' => $manage,
  45. 'href' => '#',
  46. );
  47. $data[] = array
  48. (
  49. 'name' => '计划任务',
  50. 'num' => $cron,
  51. 'href' => '#',
  52. );
  53. $data[] = array
  54. (
  55. 'name' => 'SQL语句',
  56. 'num' => $sql,
  57. 'href' => '#',
  58. );
  59. $data[] = array
  60. (
  61. 'name' => '索引数',
  62. 'num' => $opt,
  63. 'href' => '#',
  64. );
  65. return $data;
  66. }
  67. # 此处要开发插件来接管 plugin/
  68. public function data()
  69. {
  70. $data = array();
  71. return $data;
  72. }
  73. }