sensor_log.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <?php
  2. return array
  3. (
  4. # 表名
  5. 'name' => 'sensor_log',
  6. # 显示给用户看的名称
  7. 'lang' => '传感器日志',
  8. 'menu' => false,
  9. 'order' => 20,
  10. # 数据结构
  11. 'struct' => array
  12. (
  13. 'id' => array
  14. (
  15. 'type' => 'int-11',
  16. 'name' => 'ID',
  17. 'default' => '',
  18. 'desc' => '',
  19. 'match' => 'is_numeric',
  20. //'search' => 'order',
  21. //'list' => true,
  22. ),
  23. /*
  24. 'id' => array
  25. (
  26. 'type' => 'varchar-50',
  27. 'name' => 'ID',
  28. 'default' => '',
  29. 'desc' => '',
  30. 'match' => 'is_string',
  31. 'search' => 'order',
  32. 'list' => true,
  33. ),
  34. */
  35. 'product_id' => array
  36. (
  37. 'type' => 'int-11',
  38. 'name' => '成品设备',
  39. 'default' => '',
  40. 'desc' => '请输入设备ID',
  41. 'match' => 'is_numeric',
  42. 'update' => 'text',
  43. ),
  44. 'device_id' => array
  45. (
  46. 'type' => 'int-11',
  47. 'name' => '基础设备',
  48. 'default' => '',
  49. 'desc' => '请输入基础设备',
  50. 'match' => 'is_numeric',
  51. 'update' => 'text',
  52. ),
  53. 'sensor_id' => array
  54. (
  55. 'type' => 'int-11',
  56. 'name' => '传感器',
  57. 'default' => '',
  58. 'desc' => '传感器',
  59. 'match' => 'is_numeric',
  60. 'update' => 'text',
  61. //'list' => 'Dever::load("device/sensor-one#name", {sensor_id})',
  62. ),
  63. 'content' => array
  64. (
  65. 'type' => 'text-255',
  66. 'name' => '文本内容',
  67. 'default' => '',
  68. 'desc' => '文本内容',
  69. 'match' => 'is_string',
  70. 'update' => 'textarea',
  71. 'search' => 'fulltext',
  72. 'list' => true,
  73. //'modal' => '查看详情',
  74. ),
  75. 'source' => array
  76. (
  77. 'type' => 'text-255',
  78. 'name' => '原始内容',
  79. 'default' => '',
  80. 'desc' => '原始内容',
  81. 'match' => 'is_string',
  82. //'update' => 'textarea',
  83. //'search' => 'fulltext',
  84. //'list' => true,
  85. //'modal' => '查看详情',
  86. ),
  87. 'data' => array
  88. (
  89. 'type' => 'text-255',
  90. 'name' => '数据计算',
  91. 'default' => '',
  92. 'desc' => '请输入名称',
  93. 'match' => 'is_string',
  94. 'update' => 'textarea',
  95. 'search' => 'fulltext',
  96. 'list' => true,
  97. //'modal' => '查看详情',
  98. ),
  99. 'cdate' => array
  100. (
  101. 'type' => 'int-11',
  102. 'name' => '入库时间',
  103. 'match' => array('is_numeric', time()),
  104. 'desc' => '',
  105. # 只有insert时才生效
  106. 'insert' => true,
  107. 'search' => 'order',
  108. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  109. ),
  110. ),
  111. 'manage' => array
  112. (
  113. 'insert' => false,
  114. 'edit' => false,
  115. ),
  116. # request 请求接口定义
  117. 'request' => array
  118. (
  119. 'getByCdate' => array
  120. (
  121. 'option' => array
  122. (
  123. 'code_id' => 'yes',
  124. 'start' => array('yes-cdate', '>='),
  125. 'end' => array('yes-cdate', '<='),
  126. ),
  127. 'type' => 'all',
  128. 'order' => 'id',
  129. 'col' => '*',
  130. ),
  131. ),
  132. );