info.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <?php
  2. $cate = function()
  3. {
  4. $array = array();
  5. $info = Dever::load('attr/cate-state');
  6. if($info)
  7. {
  8. $array += $info;
  9. }
  10. return $array;
  11. };
  12. /*
  13. 使用该组件,这么用
  14. $attr = function()
  15. {
  16. $auth = Dever::load('attr/api.get', false);
  17. return $auth;
  18. };
  19. 'attr' => array
  20. (
  21. 'type' => 'varchar-800',
  22. 'name' => '属性设置',
  23. 'default' => '',
  24. 'desc' => '属性设置',
  25. 'match' => 'option',
  26. 'update' => 'checkbox',
  27. 'option' => $attr,
  28. 'update_input' => '',
  29. 'update_input_default' => '',
  30. 'update_parent' => 'checkbox',
  31. ),
  32. 'attr_input' => array
  33. (
  34. 'type' => 'text-255',
  35. 'name' => '属性值设置',
  36. 'default' => '',
  37. 'desc' => '属性值设置',
  38. 'match' => 'option',
  39. ),
  40. */
  41. return array
  42. (
  43. # 表名
  44. 'name' => 'info',
  45. # 显示给用户看的名称
  46. 'lang' => '属性列表',
  47. # 是否显示在后台菜单
  48. 'order' => 10,
  49. # 数据结构
  50. 'struct' => array
  51. (
  52. 'id' => array
  53. (
  54. 'type' => 'int-11',
  55. 'name' => 'ID',
  56. 'default' => '',
  57. 'desc' => '',
  58. 'match' => 'is_numeric',
  59. 'order' => 'asc',
  60. 'list' => true,
  61. ),
  62. 'name' => array
  63. (
  64. 'type' => 'varchar-150',
  65. 'name' => '属性名称',
  66. 'default' => '',
  67. 'desc' => '属性名称',
  68. 'match' => 'is_string',
  69. 'update' => 'text',
  70. 'search' => 'fulltext',
  71. 'list' => true,
  72. 'edit' => true,
  73. ),
  74. 'icon' => array
  75. (
  76. 'type' => 'varchar-150',
  77. 'name' => '图标',
  78. 'default' => '',
  79. 'desc' => '请选择图标',
  80. 'match' => 'option',
  81. 'update' => 'image',
  82. 'key' => '1',
  83. 'place' => '150',
  84. ),
  85. 'cate_id' => array
  86. (
  87. 'type' => 'int-11',
  88. 'name' => '选择分类',
  89. 'default' => '1',
  90. 'desc' => '选择分类',
  91. 'match' => 'is_numeric',
  92. 'update' => 'select',
  93. 'option' => $cate,
  94. 'list' => '{cate_id} > 0 ? Dever::load("attr/cate-one#name", {cate_id}) : "未选择"',
  95. ),
  96. 'reorder' => array
  97. (
  98. 'type' => 'int-11',
  99. 'name' => '排序(数值越大越靠前)',
  100. 'default' => '1',
  101. 'desc' => '请输入排序',
  102. 'match' => 'option',
  103. 'update' => 'text',
  104. 'search' => 'order',
  105. 'list_name' => '排序',
  106. 'list' => true,
  107. 'order' => 'desc',
  108. 'edit' => true,
  109. ),
  110. 'state' => array
  111. (
  112. 'type' => 'tinyint-1',
  113. 'name' => '状态',
  114. 'default' => '1',
  115. 'desc' => '请选择状态',
  116. 'match' => 'is_numeric',
  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. 'search' => 'date',
  127. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  128. ),
  129. ),
  130. 'manage' => array
  131. (
  132. # 列表页的类型
  133. ),
  134. 'request' => array
  135. (
  136. 'getAllByIds' => array
  137. (
  138. # 匹配的正则或函数 选填项
  139. 'option' => array
  140. (
  141. 'ids' => array('yes-id', 'in'),
  142. 'state' => 1,
  143. ),
  144. 'type' => 'all',
  145. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  146. 'col' => '*|id',
  147. ),
  148. )
  149. );