user.php 2.7 KB

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