user.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <?php
  2. $info = function()
  3. {
  4. $array = array();
  5. $info = Dever::load('set/info-state');
  6. if($info)
  7. {
  8. $array += $info;
  9. }
  10. return $array;
  11. };
  12. $type = array(
  13. 1 => '小程序',
  14. //2 => '微信公众号',
  15. );
  16. $sex = array(
  17. 0 => '未知',
  18. 1 => '男',
  19. 2 => '女',
  20. );
  21. return array
  22. (
  23. # 表名
  24. 'name' => 'user',
  25. # 显示给用户看的名称
  26. 'lang' => '用户管理',
  27. 'order' => 99,
  28. # 数据结构
  29. 'struct' => array
  30. (
  31. 'id' => array
  32. (
  33. 'type' => 'int-11',
  34. 'name' => '用户ID',
  35. 'default' => '',
  36. 'desc' => '',
  37. 'match' => 'is_numeric',
  38. //'search' => 'order',
  39. 'order' => 'desc',
  40. 'list' => true,
  41. ),
  42. 'name' => array
  43. (
  44. 'type' => 'varchar-60',
  45. 'name' => '用户昵称',
  46. 'default' => '',
  47. 'desc' => '请输入用户昵称',
  48. 'match' => 'is_string',
  49. 'update' => 'text',
  50. 'search' => 'fulltext',
  51. 'list' => true,
  52. ),
  53. 'mobile' => array
  54. (
  55. 'type' => 'int-11',
  56. 'name' => '手机号',
  57. 'default' => '',
  58. 'desc' => '手机号',
  59. 'match' => 'is_numeric',
  60. 'update' => 'text',
  61. 'search' => 'fulltext',
  62. //'list' => true,
  63. ),
  64. 'pic' => array
  65. (
  66. 'type' => 'varchar-150',
  67. 'name' => '头像',
  68. 'default' => '',
  69. 'desc' => '请选择头像',
  70. 'match' => 'is_string',
  71. 'update' => 'image',
  72. 'key' => '1',
  73. 'place' => '150',
  74. ),
  75. 'type' => array
  76. (
  77. 'type' => 'int-11',
  78. 'name' => '用户来源',
  79. 'default' => '1',
  80. 'desc' => '请选择用户来源',
  81. 'match' => 'is_numeric',
  82. 'update' => 'select',
  83. 'option' => $type,
  84. 'search' => 'select',
  85. 'list' => true,
  86. ),
  87. 'sex' => array
  88. (
  89. 'type' => 'int-11',
  90. 'name' => '用户性别',
  91. 'default' => '1',
  92. 'desc' => '请选择用户性别',
  93. 'match' => 'is_numeric',
  94. 'update' => 'select',
  95. 'option' => $sex,
  96. 'search' => 'select',
  97. 'list' => true,
  98. ),
  99. 'city' => array
  100. (
  101. 'type' => 'varchar-200',
  102. 'name' => '城市',
  103. 'default' => '',
  104. 'desc' => '请输入用户城市',
  105. 'match' => 'is_string',
  106. 'update' => 'text',
  107. //'search' => 'fulltext',
  108. 'list' => true,
  109. ),
  110. 'province' => array
  111. (
  112. 'type' => 'varchar-200',
  113. 'name' => '省份',
  114. 'default' => '',
  115. 'desc' => '请输入用户身份',
  116. 'match' => 'is_string',
  117. 'update' => 'text',
  118. //'search' => 'fulltext',
  119. 'list' => true,
  120. ),
  121. 'country' => array
  122. (
  123. 'type' => 'varchar-200',
  124. 'name' => '国家',
  125. 'default' => '',
  126. 'desc' => '请输入用户国家',
  127. 'match' => 'is_string',
  128. 'update' => 'text',
  129. //'search' => 'fulltext',
  130. //'list' => true,
  131. ),
  132. 'state' => array
  133. (
  134. 'type' => 'tinyint-1',
  135. 'name' => '状态',
  136. 'default' => '1',
  137. 'desc' => '请选择状态',
  138. 'match' => 'is_numeric',
  139. ),
  140. 'cdate' => array
  141. (
  142. 'type' => 'int-11',
  143. 'name' => '录入时间',
  144. 'match' => array('is_numeric', time()),
  145. 'desc' => '',
  146. # 只有insert时才生效
  147. 'insert' => true,
  148. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  149. ),
  150. ),
  151. 'manage' => array
  152. (
  153. 'insert' => false,
  154. 'edit' => false,
  155. 'delete' => false,
  156. ),
  157. # request 请求接口定义
  158. 'request' => array
  159. (
  160. ),
  161. );