role.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <?php
  2. # 定义几个常用的选项
  3. $status = Dever::config('base')->status;
  4. $sex = array
  5. (
  6. 1 => '男',
  7. 2 => '女',
  8. 3 => '未知',
  9. );
  10. return array
  11. (
  12. # 表名
  13. 'name' => 'role',
  14. # 显示给用户看的名称
  15. 'lang' => '角色设置',
  16. 'order' => 100,
  17. 'menu' => false,
  18. # 数据结构
  19. 'struct' => array
  20. (
  21. 'id' => array
  22. (
  23. 'type' => 'int-11',
  24. 'name' => 'ID',
  25. 'default' => '',
  26. 'desc' => '',
  27. 'match' => 'is_numeric',
  28. 'search' => 'order',
  29. //'list' => true,
  30. ),
  31. 'info_id' => array
  32. (
  33. 'type' => 'int-11',
  34. 'name' => '合集',
  35. 'default' => '',
  36. 'desc' => '合集',
  37. 'match' => 'is_numeric',
  38. 'update' => 'hidden',
  39. 'value' => Dever::input('search_option_info_id')
  40. ),
  41. 'name' => array
  42. (
  43. 'type' => 'varchar-300',
  44. 'name' => '角色名称',
  45. 'default' => '',
  46. 'desc' => '角色名称',
  47. 'match' => 'is_string',
  48. 'update' => 'text',
  49. 'search' => 'fulltext',
  50. 'list' => true,
  51. ),
  52. 'price' => array
  53. (
  54. 'type' => 'varchar-50',
  55. 'name' => '角色价格-为0则免费',
  56. 'default' => '0',
  57. 'desc' => '角色价格',
  58. 'match' => 'is_string',
  59. 'update' => 'text',
  60. 'list' => true,
  61. ),
  62. 'avatar' => array
  63. (
  64. 'type' => 'varchar-150',
  65. 'name' => '头像',
  66. 'default' => '',
  67. 'desc' => '请选择头像',
  68. 'match' => 'option',
  69. 'update' => 'image',
  70. 'key' => '1',
  71. 'place' => '150',
  72. 'list_name' => '详细信息',
  73. 'list' => '"{avatar}" ? "<img src=\'{avatar}\' width=\'150\'>": ""',
  74. //'list' => 'Dever::load("passport/lib/manage.show", {id})',
  75. ),
  76. 'sex' => array
  77. (
  78. 'type' => 'tinyint-1',
  79. 'name' => '性别',
  80. 'default' => '3',
  81. 'desc' => '性别',
  82. 'match' => 'is_numeric',
  83. 'option' => $sex,
  84. 'update' => 'radio',
  85. 'list' => true,
  86. ),
  87. 'title' => array
  88. (
  89. 'type' => 'varchar-800',
  90. 'name' => '头衔-头衔,如果为空则使用用户头衔',
  91. 'default' => '',
  92. 'desc' => '请输入头衔',
  93. 'match' => 'option',
  94. 'update' => 'text',
  95. //'search' => 'fulltext',
  96. //'list' => true,
  97. ),
  98. 'info' => array
  99. (
  100. 'type' => 'varchar-800',
  101. 'name' => '签名-签名,如果为空则使用用户签名',
  102. 'default' => '',
  103. 'desc' => '签名',
  104. 'match' => 'option',
  105. 'update' => 'text',
  106. //'search' => 'fulltext',
  107. //'list' => true,
  108. ),
  109. 'status' => array
  110. (
  111. 'type' => 'int-11',
  112. 'name' => '上线状态',
  113. 'default' => '2',
  114. 'desc' => '上线状态',
  115. 'match' => 'is_numeric',
  116. //'update' => 'select',
  117. 'option' => $status,
  118. 'search' => 'select',
  119. 'list' => true,
  120. 'edit' => true,
  121. ),
  122. 'state' => array
  123. (
  124. 'type' => 'tinyint-1',
  125. 'name' => '状态',
  126. 'default' => '1',
  127. 'desc' => '请选择状态',
  128. 'match' => 'is_numeric',
  129. ),
  130. 'cdate' => array
  131. (
  132. 'type' => 'int-11',
  133. 'name' => '添加时间',
  134. 'match' => array('is_numeric', time()),
  135. 'desc' => '',
  136. # 只有insert时才生效
  137. 'insert' => true,
  138. //'search' => 'date',
  139. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  140. ),
  141. ),
  142. 'manage' => array
  143. (
  144. ),
  145. 'request' => array
  146. (
  147. 'getAll' => array
  148. (
  149. # 匹配的正则或函数 选填项
  150. 'option' => array
  151. (
  152. 'info_id' => 'yes',
  153. 'state' => 1,
  154. ),
  155. 'type' => 'all',
  156. 'order' => array('num' => 'asc', 'cdate' => 'desc'),
  157. 'col' => '*',
  158. 'call' => 'collection/lib/buy.getInfo',
  159. ),
  160. ),
  161. );