user.php 2.4 KB

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