product.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <?php
  2. # 定义几个常用的选项
  3. $option = array
  4. (
  5. 1 => '可用',
  6. 2 => '不可用',
  7. );
  8. $type = array
  9. (
  10. 1 => '未激活',
  11. 2 => '已激活',
  12. 3 => '不可用',
  13. );
  14. return array
  15. (
  16. # 表名
  17. 'name' => 'product',
  18. # 显示给用户看的名称
  19. 'lang' => '成品设备管理',
  20. # 后台菜单排序
  21. 'order' => 30,
  22. # 数据结构
  23. 'struct' => array
  24. (
  25. 'id' => array
  26. (
  27. 'type' => 'int-11',
  28. 'name' => '设备ID',
  29. 'default' => '',
  30. 'desc' => '',
  31. 'match' => 'is_numeric',
  32. 'search' => 'order',
  33. 'order' => 'desc',
  34. //'list' => true,
  35. ),
  36. 'info_id' => array
  37. (
  38. 'type' => 'int-11',
  39. 'name' => '基础设备',
  40. 'default' => '1',
  41. 'desc' => '请选择基础设备',
  42. 'match' => 'is_numeric',
  43. 'option' => $info,
  44. 'update' => 'select',
  45. 'search' => 'select',
  46. 'list_name' => '设备名称',
  47. 'list' => '"{id}号" . Dever::load("device/info-one#name", {info_id})',
  48. ),
  49. 'key' => array
  50. (
  51. 'type' => 'varchar-60',
  52. 'name' => '设备标识',
  53. 'default' => '',
  54. 'desc' => '设备标识',
  55. 'match' => 'is_string',
  56. //'update' => 'text',
  57. 'search' => 'fulltext',
  58. 'list' => true,
  59. ),
  60. 'api' => array
  61. (
  62. 'type' => 'varchar-200',
  63. 'name' => '设备网关',
  64. 'default' => '',
  65. 'desc' => '设备网关',
  66. 'match' => 'is_string',
  67. 'update' => 'textarea',
  68. 'search' => 'fulltext',
  69. //'list' => true,
  70. ),
  71. 'ip' => array
  72. (
  73. 'type' => 'varchar-200',
  74. 'name' => '设备IP或域名',
  75. 'default' => '',
  76. 'desc' => '设备IP或域名',
  77. 'match' => 'is_string',
  78. 'update' => 'textarea',
  79. 'search' => 'fulltext',
  80. 'list' => true,
  81. ),
  82. 'type' => array
  83. (
  84. 'type' => 'tinyint-1',
  85. 'name' => '是否激活',
  86. 'default' => '1',
  87. 'desc' => '请选择是否激活',
  88. 'match' => 'is_numeric',
  89. 'option' => $type,
  90. 'update' => 'select',
  91. 'search' => 'select',
  92. 'list' => true,
  93. ),
  94. 'reorder' => array
  95. (
  96. 'type' => 'int-11',
  97. 'name' => '排序-数值越大越靠前',
  98. 'default' => '1',
  99. 'desc' => '请输入排序',
  100. 'match' => 'option',
  101. 'update' => 'text',
  102. 'search' => 'order',
  103. 'list' => true,
  104. 'order' => 'desc',
  105. 'edit' => true,
  106. ),
  107. 'state' => array
  108. (
  109. 'type' => 'tinyint-1',
  110. 'name' => '状态',
  111. 'default' => '1',
  112. 'desc' => '请选择状态',
  113. 'match' => 'is_numeric',
  114. 'option' => $option,
  115. 'update' => 'radio',
  116. 'list' => true,
  117. ),
  118. 'cdate' => array
  119. (
  120. 'type' => 'int-11',
  121. 'name' => '录入时间',
  122. 'match' => array('is_numeric', time()),
  123. 'desc' => '',
  124. # 只有insert时才生效
  125. 'insert' => true,
  126. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  127. ),
  128. ),
  129. # request 请求接口定义
  130. 'request' => array
  131. (
  132. ),
  133. );