member.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <?php
  2. $role = array
  3. (
  4. 1 => '管理员',
  5. 2 => '配货员',
  6. 3 => '库存管理员',
  7. 4 => '财务',
  8. );
  9. $factory = function()
  10. {
  11. $array = array();
  12. $info = Dever::db('factory/info')->select();
  13. if($info)
  14. {
  15. $array += $info;
  16. }
  17. return $array;
  18. };
  19. return array
  20. (
  21. # 表名
  22. 'name' => 'member',
  23. # 显示给用户看的名称
  24. 'lang' => '账号管理',
  25. # 数据结构
  26. 'struct' => array
  27. (
  28. 'id' => array
  29. (
  30. 'type' => 'int-11',
  31. 'name' => 'ID',
  32. 'default' => '',
  33. 'desc' => '',
  34. 'match' => 'is_numeric',
  35. 'search' => 'order',
  36. 'update' => 'hidden',
  37. //'list' => true,
  38. ),
  39. 'factory_id' => array
  40. (
  41. 'type' => 'int-11',
  42. 'name' => '所属工厂',
  43. 'default' => '',
  44. 'desc' => '所属工厂',
  45. 'match' => 'is_numeric',
  46. 'update' => 'select',
  47. 'option' => $factory,
  48. 'list' => 'Dever::load("factory/info-find#name", {factory_id})';
  49. ),
  50. 'name' => array
  51. (
  52. 'type' => 'varchar-50',
  53. 'name' => '员工姓名',
  54. 'default' => '',
  55. 'desc' => '请输入员工姓名',
  56. 'match' => 'is_string',
  57. 'update' => 'text',
  58. 'search' => 'fulltext',
  59. 'list' => true,
  60. ),
  61. 'mobile' => array
  62. (
  63. 'type' => 'int-11',
  64. 'name' => '员工电话',
  65. 'default' => '',
  66. 'desc' => '请输入员工电话',
  67. 'match' => 'is_numeric',
  68. 'update' => 'text',
  69. 'search' => 'fulltext',
  70. 'list' => true,
  71. ),
  72. 'avatar' => array
  73. (
  74. 'type' => 'varchar-150',
  75. 'name' => '员工头像',
  76. 'default' => '',
  77. 'desc' => '请选择员工头像',
  78. 'match' => 'option',
  79. 'update' => 'image',
  80. 'key' => '1',
  81. 'place' => '150',
  82. ),
  83. 'role_id' => array
  84. (
  85. 'type' => 'varchar-60',
  86. 'name' => '角色',
  87. 'default' => '1',
  88. 'desc' => '角色',
  89. 'match' => 'is_numeric',
  90. 'update' => 'checkbox',
  91. 'option' => $role,
  92. 'list' => true,
  93. ),
  94. 'state' => array
  95. (
  96. 'type' => 'tinyint-1',
  97. 'name' => '状态',
  98. 'default' => '1',
  99. 'desc' => '请选择状态',
  100. 'match' => 'is_numeric',
  101. ),
  102. 'cdate' => array
  103. (
  104. 'type' => 'int-11',
  105. 'name' => '创建时间',
  106. 'match' => array('is_numeric', time()),
  107. 'desc' => '',
  108. # 只有insert时才生效
  109. //'insert' => true,
  110. 'search' => 'date',
  111. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  112. ),
  113. ),
  114. 'manage' => array
  115. (
  116. ),
  117. 'request' => array
  118. (
  119. ),
  120. );