member.php 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <?php
  2. $role = array
  3. (
  4. 1 => '管理员',
  5. 2 => '配货员',
  6. 4 => '财务',
  7. );
  8. return array
  9. (
  10. # 表名
  11. 'name' => 'member',
  12. # 显示给用户看的名称
  13. 'lang' => '账号管理',
  14. 'menu' => false,
  15. 'check' => 'mobile',
  16. 'role' => $role,
  17. # 数据结构
  18. 'struct' => array
  19. (
  20. 'id' => array
  21. (
  22. 'type' => 'int-11',
  23. 'name' => 'ID',
  24. 'default' => '',
  25. 'desc' => '',
  26. 'match' => 'is_numeric',
  27. 'search' => 'order',
  28. 'update' => 'hidden',
  29. //'list' => true,
  30. ),
  31. 'uid' => array
  32. (
  33. 'type' => 'int-11',
  34. 'name' => '用户名',
  35. 'default' => '0',
  36. 'desc' => '请选择用户',
  37. 'match' => 'is_numeric',
  38. //'update' => 'text',
  39. //'search' => 'select',
  40. 'search' => array
  41. (
  42. 'api' => 'passport/user-all',
  43. 'col' => 'username',
  44. 'result' => 'id',
  45. ),
  46. //'list' => '{uid} > 0 ? Dever::load("passport/user-find#username", {uid}) : "匿名用户"',
  47. ),
  48. 'factory_id' => array
  49. (
  50. 'type' => 'int-11',
  51. 'name' => '所属工厂',
  52. 'default' => '',
  53. 'desc' => '所属工厂',
  54. 'match' => 'is_numeric',
  55. 'update' => 'hidden',
  56. 'search' => 'hidden',
  57. 'value' => Dever::input('search_option_factory_id'),
  58. 'list' => 'Dever::load("factory/info-find#name", {factory_id})',
  59. ),
  60. 'role_id' => array
  61. (
  62. 'type' => 'varchar-60',
  63. 'name' => '角色',
  64. 'default' => '1',
  65. 'desc' => '角色',
  66. 'match' => 'is_numeric',
  67. 'update' => 'checkbox',
  68. 'option' => $role,
  69. 'list' => true,
  70. ),
  71. 'name' => array
  72. (
  73. 'type' => 'varchar-32',
  74. 'name' => '员工姓名',
  75. 'default' => '',
  76. 'desc' => '请输入仓库名称',
  77. 'match' => 'is_string',
  78. 'update' => 'text',
  79. 'search' => 'fulltext',
  80. 'list' => true,
  81. ),
  82. 'mobile' => array
  83. (
  84. 'type' => 'bigint-11',
  85. 'name' => '员工手机号',
  86. 'default' => '',
  87. 'desc' => '请输入员工手机号',
  88. 'match' => Dever::rule('mobile'),
  89. 'update' => 'text',
  90. 'search' => 'fulltext',
  91. 'list' => true,
  92. ),
  93. 'avatar' => array
  94. (
  95. 'type' => 'varchar-150',
  96. 'name' => '头像',
  97. 'default' => '',
  98. 'desc' => '请选择头像',
  99. 'match' => 'option',
  100. 'update' => 'image',
  101. 'key' => '1',
  102. 'place' => '150',
  103. ),
  104. 'state' => array
  105. (
  106. 'type' => 'tinyint-1',
  107. 'name' => '状态',
  108. 'default' => '1',
  109. 'desc' => '请选择状态',
  110. 'match' => 'is_numeric',
  111. ),
  112. 'cdate' => array
  113. (
  114. 'type' => 'int-11',
  115. 'name' => '创建时间',
  116. 'match' => array('is_numeric', time()),
  117. 'desc' => '',
  118. # 只有insert时才生效
  119. //'insert' => true,
  120. 'search' => 'date',
  121. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  122. ),
  123. ),
  124. 'manage' => array
  125. (
  126. ),
  127. 'request' => array
  128. (
  129. 'getManage' => array
  130. (
  131. # 匹配的正则或函数 选填项
  132. 'option' => array
  133. (
  134. 'factory_id' => 'yes',
  135. 'name' => array('yes', 'like'),
  136. 'role_id' => array('yes', 'like'),
  137. 'state' => 1,
  138. ),
  139. 'type' => 'one',
  140. 'order' => array('id' => 'asc'),
  141. 'col' => '*',
  142. ),
  143. ),
  144. );