user_buy_stat.php 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <?php
  2. $config = array
  3. (
  4. # 表名
  5. 'name' => 'user_buy_stat',
  6. # 显示给用户看的名称
  7. 'lang' => '用户排名统计',
  8. 'order' => -1,
  9. # 数据结构 不同的字段放这里
  10. 'struct' => array
  11. (
  12. 'id' => array
  13. (
  14. 'type' => 'int-11',
  15. 'name' => 'ID',
  16. 'default' => '',
  17. 'desc' => '',
  18. 'match' => 'is_numeric',
  19. //'list' => true,
  20. ),
  21. 'day' => array
  22. (
  23. 'type' => 'int-11',
  24. 'name' => '日期',
  25. 'default' => '',
  26. 'match' => 'is_numeric',
  27. 'desc' => '',
  28. 'search' => 'sday',
  29. 'search_buttons' => array
  30. (
  31. 'sum' => 'num,cash',
  32. 'option' => array(
  33. 'day' => '按天',
  34. 'week' => '按周',
  35. 'month' => '按月',
  36. ),
  37. 'group' => 'uid',
  38. ),
  39. 'order' => 'desc',
  40. //'list' => 'Dever::showDay("{day}")',
  41. ),
  42. 'uid' => array
  43. (
  44. 'type' => 'int-11',
  45. 'name' => '用户名',
  46. 'default' => '',
  47. 'desc' => '用户名',
  48. 'match' => 'is_numeric',
  49. 'search' => 'select',
  50. 'update' => 'hidden',
  51. 'search' => 'hidden',
  52. 'search' => array
  53. (
  54. 'api' => 'passport/user-like',
  55. 'col' => 'username',
  56. 'result' => 'id',
  57. ),
  58. 'list' => 'Dever::load("passport/user-one#username", {uid})',
  59. ),
  60. 'area' => array
  61. (
  62. 'type' => 'varchar-500',
  63. 'name' => '客户所在城市',
  64. 'default' => '',
  65. 'desc' => '客户所在城市',
  66. 'match' => 'option',
  67. 'search' => 'linkage',
  68. 'update' => 'linkage',
  69. 'option' => Dever::url('api.get', 'area'),
  70. 'list' => 'Dever::load("area/api.string", "{area}")',
  71. ),
  72. 'wechat' => array
  73. (
  74. 'type' => 'varchar-100',
  75. 'name' => '微信号',
  76. 'default' => '0',
  77. 'desc' => '微信号',
  78. 'match' => 'is_string',
  79. 'list' => true,
  80. ),
  81. 'mobile' => array
  82. (
  83. 'type' => 'varchar-32',
  84. 'name' => '手机号',
  85. 'default' => '0',
  86. 'desc' => '手机号',
  87. 'match' => 'is_string',
  88. 'list' => true,
  89. ),
  90. 'num' => array
  91. (
  92. 'type' => 'int-11',
  93. 'name' => '数量',
  94. 'default' => '0',
  95. 'desc' => '数量',
  96. 'match' => 'is_numeric',
  97. 'search' => 'order',
  98. 'list' => true,
  99. ),
  100. 'cash' => array
  101. (
  102. 'type' => 'varchar-100',
  103. 'name' => '金额',
  104. 'default' => '0',
  105. 'desc' => '金额',
  106. 'match' => 'is_string',
  107. 'search' => 'order',
  108. 'list' => true,
  109. ),
  110. 'state' => array
  111. (
  112. 'type' => 'tinyint-1',
  113. 'name' => '数据状态',
  114. 'default' => '1',
  115. 'desc' => '请选择状态',
  116. 'match' => 'is_numeric',
  117. ),
  118. 'cdate' => array
  119. (
  120. 'type' => 'int-11',
  121. 'name' => '发布时间',
  122. 'match' => array('is_numeric', time()),
  123. 'desc' => '',
  124. # 只有insert时才生效
  125. 'insert' => true,
  126. //'search' => 'date',
  127. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  128. ),
  129. ),
  130. 'manage' => array
  131. (
  132. 'insert' => false,
  133. 'edit' => false,
  134. 'delete' => false,
  135. 'num' => false,
  136. 'excel' => true,
  137. ),
  138. # request 请求接口定义
  139. 'request' => array
  140. (
  141. 'list' => array
  142. (
  143. # 匹配的正则或函数 选填项
  144. 'option' => array
  145. (
  146. 'uid' => 'yes',
  147. 'area' => array('yes', 'like'),
  148. 'wechat' => array('yes', 'like'),
  149. 'mobile' => array('yes', 'like'),
  150. 'start_day' => array('yes-day', '>='),
  151. 'end_day' => array('yes-day', '<='),
  152. 'state' => 1,
  153. ),
  154. 'type' => 'all',
  155. 'order' => array('day' => 'desc', 'cdate' => 'desc'),
  156. 'page' => array(20, 'list'),
  157. 'group' => 'uid',
  158. 'col' => '*,sum(cash) as cash, sum(num) as num',
  159. ),
  160. ),
  161. );
  162. return $config;