data.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <?php
  2. $project = function()
  3. {
  4. $array = array();
  5. $info = Dever::db('log/project')->state();
  6. if($info)
  7. {
  8. $array += $info;
  9. }
  10. return $array;
  11. };
  12. return array
  13. (
  14. # 表名
  15. 'name' => 'data',
  16. # 显示给用户看的名称
  17. 'lang' => '数据统计',
  18. 'order' => 1,
  19. 'check' => 'key',
  20. # 数据结构
  21. 'struct' => array
  22. (
  23. 'id' => array
  24. (
  25. 'type' => 'int-11',
  26. 'name' => 'ID',
  27. 'default' => '',
  28. 'desc' => '',
  29. 'match' => 'is_numeric',
  30. //'search' => 'order',
  31. 'order' => 'desc',
  32. //'list' => true,
  33. ),
  34. 'project_id' => array
  35. (
  36. 'type' => 'int-11',
  37. 'name' => '项目',
  38. 'default' => '1',
  39. 'desc' => '项目',
  40. 'match' => 'is_numeric',
  41. 'option' => $project,
  42. //'update' => 'select',
  43. 'search' => 'select',
  44. 'list' => true,
  45. ),
  46. 'year' => array
  47. (
  48. 'type' => 'int-11',
  49. 'name' => '时间',
  50. 'default' => '',
  51. 'desc' => '年',
  52. 'match' => 'is_numeric',
  53. 'update' => 'text',
  54. 'list' => '"{year}年{month}月{day}日{hour}时"',
  55. ),
  56. 'month' => array
  57. (
  58. 'type' => 'int-11',
  59. 'name' => '月',
  60. 'default' => '',
  61. 'desc' => '月',
  62. 'match' => 'is_numeric',
  63. 'update' => 'text',
  64. ),
  65. 'day' => array
  66. (
  67. 'type' => 'int-11',
  68. 'name' => '日',
  69. 'default' => '',
  70. 'desc' => '日',
  71. 'match' => 'is_numeric',
  72. 'update' => 'text',
  73. ),
  74. 'hour' => array
  75. (
  76. 'type' => 'int-11',
  77. 'name' => '小时',
  78. 'default' => '',
  79. 'desc' => '小时',
  80. 'match' => 'is_numeric',
  81. 'update' => 'text',
  82. ),
  83. 'time' => array
  84. (
  85. 'type' => 'int-11',
  86. 'name' => '时间',
  87. 'default' => '',
  88. 'desc' => '时间',
  89. 'match' => 'is_numeric',
  90. 'search' => 'time',
  91. 'update' => 'text',
  92. ),
  93. 'pv' => array
  94. (
  95. 'type' => 'int-11',
  96. 'name' => 'PV',
  97. 'default' => '',
  98. 'desc' => 'PV',
  99. 'match' => 'is_numeric',
  100. 'update' => 'text',
  101. 'search' => 'order',
  102. 'list' => true,
  103. ),
  104. 'uv' => array
  105. (
  106. 'type' => 'int-11',
  107. 'name' => 'UV',
  108. 'default' => '',
  109. 'desc' => 'UV',
  110. 'match' => 'is_numeric',
  111. 'update' => 'text',
  112. 'search' => 'order',
  113. 'list' => true,
  114. ),
  115. 'state' => array
  116. (
  117. 'type' => 'tinyint-1',
  118. 'name' => '状态',
  119. 'default' => '1',
  120. 'desc' => '请选择状态',
  121. 'match' => 'is_numeric',
  122. ),
  123. 'cdate' => array
  124. (
  125. 'type' => 'int-11',
  126. 'name' => '录入时间',
  127. 'match' => array('is_numeric', time()),
  128. 'desc' => '',
  129. # 只有insert时才生效
  130. 'insert' => true,
  131. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  132. ),
  133. ),
  134. 'manage' => array
  135. (
  136. 'delete' => false,
  137. 'edit' => false,
  138. 'insert' => false,
  139. ),
  140. # request 请求接口定义
  141. 'request' => array
  142. (
  143. ),
  144. );