user.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <?php
  2. $source = function()
  3. {
  4. $info = Dever::db('source/info')->state();
  5. if($info)
  6. {
  7. $array += $info;
  8. }
  9. return $array;
  10. };
  11. return array
  12. (
  13. # 表名
  14. 'name' => 'user',
  15. # 显示给用户看的名称
  16. 'lang' => '渠道用户',
  17. 'order' => 10,
  18. 'menu' => false,
  19. # 数据结构
  20. 'struct' => array
  21. (
  22. 'id' => array
  23. (
  24. 'type' => 'int-11',
  25. 'name' => 'ID',
  26. 'default' => '',
  27. 'desc' => '',
  28. 'match' => 'is_numeric',
  29. ),
  30. 'vid' => array
  31. (
  32. 'type' => 'int-11',
  33. 'name' => '第三方id',
  34. 'default' => '',
  35. 'desc' => '第三方id',
  36. 'match' => 'is_numeric',
  37. 'update' => 'text',
  38. 'list' => true,
  39. ),
  40. 'uid' => array
  41. (
  42. 'type' => 'int-11',
  43. 'name' => '用户id',
  44. 'default' => '',
  45. 'desc' => '用户id',
  46. 'match' => 'is_numeric',
  47. 'update' => 'text',
  48. 'list' => true,
  49. ),
  50. 'source_id' => array
  51. (
  52. 'type' => 'int-11',
  53. 'name' => '渠道',
  54. 'default' => '',
  55. 'desc' => '渠道',
  56. 'match' => 'is_numeric',
  57. 'update' => 'text',
  58. 'option' => $source,
  59. 'search' => 'select',
  60. 'list' => true,
  61. ),
  62. 'account_type' => array
  63. (
  64. 'type' => 'int-11',
  65. 'name' => 'account_type',
  66. 'default' => '',
  67. 'desc' => 'account_type',
  68. 'match' => 'is_numeric',
  69. 'update' => 'text',
  70. 'list' => true,
  71. ),
  72. 'account_id' => array
  73. (
  74. 'type' => 'int-11',
  75. 'name' => 'account_id',
  76. 'default' => '',
  77. 'desc' => 'account_id',
  78. 'match' => 'is_numeric',
  79. 'update' => 'text',
  80. 'list' => true,
  81. ),
  82. 'state' => array
  83. (
  84. 'type' => 'tinyint-1',
  85. 'name' => '状态',
  86. 'default' => '1',
  87. 'desc' => '请选择状态',
  88. 'match' => 'is_numeric',
  89. ),
  90. 'cdate' => array
  91. (
  92. 'type' => 'int-11',
  93. 'name' => '录入时间',
  94. 'match' => array('is_numeric', time()),
  95. 'desc' => '',
  96. # 只有insert时才生效
  97. 'insert' => true,
  98. ),
  99. ),
  100. 'manage' => array
  101. (
  102. 'delete' => false,
  103. 'edit' => false,
  104. //'insert' => false,
  105. ),
  106. # request 请求接口定义
  107. 'request' => array
  108. (
  109. 'getTotal' => array
  110. (
  111. # 匹配的正则或函数 选填项
  112. 'option' => array
  113. (
  114. 'source_id' => 'yes',
  115. 'start' => array('yes-cdate', '>='),
  116. 'end' => array('yes-cdate', '<='),
  117. 'state' => 1,
  118. ),
  119. 'type' => 'count',
  120. ),
  121. ),
  122. );