user_rank_stat.php 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <?php
  2. $config = array
  3. (
  4. # 表名
  5. 'name' => 'user_rank_stat',
  6. # 显示给用户看的名称
  7. 'lang' => '用户排名统计',
  8. 'order' => -13,
  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' => 'day',
  29. 'search_button' => array
  30. (
  31. 'sum' => 'num,cash',
  32. 'option' => array(
  33. 'day' => '按天',
  34. 'week' => '按周',
  35. 'month' => '按月',
  36. ),
  37. 'group' => 'day,mobile',
  38. ),
  39. 'order' => 'desc',
  40. 'list' => 'Dever::showDay("{day}")',
  41. ),
  42. 'shop_id' => array
  43. (
  44. 'type' => 'int-11',
  45. 'name' => '门店名称',
  46. 'default' => '',
  47. 'desc' => '门店名称',
  48. 'match' => 'is_numeric',
  49. 'search' => 'select',
  50. //'option' => $shop,
  51. 'update' => 'hidden',
  52. 'search' => 'hidden',
  53. 'search' => array
  54. (
  55. 'api' => 'shop/info-like',
  56. 'col' => 'name',
  57. 'result' => 'id',
  58. ),
  59. 'value' => Dever::input('search_option_shop_id'),
  60. //'list' => 'Dever::load("shop/info-one#name", {shop_id})',
  61. ),
  62. 'area' => array
  63. (
  64. 'type' => 'varchar-500',
  65. 'name' => '所在街道',
  66. 'default' => '',
  67. 'desc' => '所在街道',
  68. 'match' => 'option',
  69. 'search' => 'linkage',
  70. 'update' => 'linkage',
  71. 'option' => Dever::url('lib/area.get', 'shop'),
  72. //'list' => 'Dever::load("area/api.string", "{area}")',
  73. ),
  74. 'mobile' => array
  75. (
  76. 'type' => 'bigint-11',
  77. 'name' => '客户手机号',
  78. 'default' => '',
  79. 'desc' => '客户手机号',
  80. 'match' => 'is_numeric',
  81. 'list' => true,
  82. ),
  83. 'num' => array
  84. (
  85. 'type' => 'int-11',
  86. 'name' => '数量',
  87. 'default' => '0',
  88. 'desc' => '数量',
  89. 'match' => 'is_numeric',
  90. 'search' => 'order',
  91. 'list' => true,
  92. ),
  93. 'cash' => array
  94. (
  95. 'type' => 'varchar-100',
  96. 'name' => '金额',
  97. 'default' => '0',
  98. 'desc' => '金额',
  99. 'match' => 'is_string',
  100. 'search' => 'order',
  101. 'list' => 'round({cash}, 2)',
  102. ),
  103. 'hb' => array
  104. (
  105. 'type' => 'varchar-100',
  106. 'name' => '环比增长',
  107. 'default' => '0',
  108. 'desc' => '环比增长',
  109. 'match' => 'option',
  110. 'update' => 'text',
  111. 'list' => 'Dever::load("shop/lib/manage.getUserRankHb", "{num}", "{mobile}", "{time}")',
  112. ),
  113. 'state' => array
  114. (
  115. 'type' => 'tinyint-1',
  116. 'name' => '数据状态',
  117. 'default' => '1',
  118. 'desc' => '请选择状态',
  119. 'match' => 'is_numeric',
  120. ),
  121. 'cdate' => array
  122. (
  123. 'type' => 'int-11',
  124. 'name' => '发布时间',
  125. 'match' => array('is_numeric', time()),
  126. 'desc' => '',
  127. # 只有insert时才生效
  128. 'insert' => true,
  129. //'search' => 'date',
  130. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  131. ),
  132. ),
  133. 'manage' => array
  134. (
  135. 'insert' => false,
  136. 'edit' => false,
  137. 'delete' => false,
  138. 'num' => false,
  139. 'excel' => true,
  140. ),
  141. # request 请求接口定义
  142. 'request' => array
  143. (
  144. 'list' => array
  145. (
  146. # 匹配的正则或函数 选填项
  147. 'option' => array
  148. (
  149. 'shop_id' => 'yes',
  150. 'mobile' => 'yes',
  151. 'area' => array('yes', 'like'),
  152. 'start_day' => array('yes-day', '>='),
  153. 'end_day' => array('yes-day', '<='),
  154. 'state' => 1,
  155. ),
  156. 'type' => 'all',
  157. 'order' => array('time' => 'desc', 'cdate' => 'desc'),
  158. 'page' => array(20, 'list'),
  159. 'group' => 'day,mobile',
  160. 'col' => '*,min(day) as time, sum(cash) as cash, sum(num) as num',
  161. ),
  162. 'prev' => array
  163. (
  164. # 匹配的正则或函数 选填项
  165. 'option' => array
  166. (
  167. 'day' => array('yes-day', '<'),
  168. 'mobile' => 'yes',
  169. //'start_day' => array('yes-day', '>='),
  170. //'end_day' => array('yes-day', '<='),
  171. 'state' => 1,
  172. ),
  173. 'order' => array('time' => 'desc', 'id' => 'desc'),
  174. 'type' => 'one',
  175. 'col' => '*,min(day) as time, sum(cash) as cash, sum(num) as num',
  176. 'group' => 'day,mobile',
  177. # 允许自定义以上配置
  178. 'config' => true,
  179. ),
  180. ),
  181. );
  182. return $config;