shop_stat.php 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <?php
  2. $config = array
  3. (
  4. # 表名
  5. 'name' => 'shop_stat',
  6. # 显示给用户看的名称
  7. 'lang' => '门店数据统计',
  8. 'order' => -11,
  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' => 'buy_num,buy_cash,sell_num,sell_cash,sl_num',
  32. 'option' => array(
  33. 'day' => '按天',
  34. 'week' => '按周',
  35. 'month' => '按月',
  36. ),
  37. 'group' => 'shop_id',
  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. 'buy_num' => array
  75. (
  76. 'type' => 'int-11',
  77. 'name' => '采购订单量',
  78. 'default' => '0',
  79. 'desc' => '采购订单量',
  80. 'match' => 'is_numeric',
  81. 'list' => true,
  82. ),
  83. 'buy_cash' => array
  84. (
  85. 'type' => 'varchar-100',
  86. 'name' => '采购金额',
  87. 'default' => '0',
  88. 'desc' => '采购金额',
  89. 'match' => 'is_string',
  90. 'search' => 'order',
  91. 'list' => 'round({buy_cash}, 2)',
  92. ),
  93. 'sell_num' => array
  94. (
  95. 'type' => 'int-11',
  96. 'name' => '销售订单量',
  97. 'default' => '0',
  98. 'desc' => '销售订单量',
  99. 'match' => 'is_numeric',
  100. 'list' => true,
  101. ),
  102. 'sell_cash' => array
  103. (
  104. 'type' => 'varchar-100',
  105. 'name' => '销售金额',
  106. 'default' => '0',
  107. 'desc' => '销售金额',
  108. 'match' => 'is_string',
  109. 'search' => 'order',
  110. 'list' => 'round({sell_cash}, 2)',
  111. ),
  112. 'sl_num' => array
  113. (
  114. 'type' => 'int-11',
  115. 'name' => '沙龙消耗商品数量',
  116. 'default' => '0',
  117. 'desc' => '沙龙消耗商品数量',
  118. 'match' => 'is_numeric',
  119. 'search' => 'order',
  120. //'list' => true,
  121. ),
  122. 'state' => array
  123. (
  124. 'type' => 'tinyint-1',
  125. 'name' => '数据状态',
  126. 'default' => '1',
  127. 'desc' => '请选择状态',
  128. 'match' => 'is_numeric',
  129. ),
  130. 'cdate' => array
  131. (
  132. 'type' => 'int-11',
  133. 'name' => '发布时间',
  134. 'match' => array('is_numeric', time()),
  135. 'desc' => '',
  136. # 只有insert时才生效
  137. 'insert' => true,
  138. //'search' => 'date',
  139. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  140. ),
  141. ),
  142. 'manage' => array
  143. (
  144. 'insert' => false,
  145. 'edit' => false,
  146. 'delete' => false,
  147. 'num' => false,
  148. 'excel' => true,
  149. ),
  150. # request 请求接口定义
  151. 'request' => array
  152. (
  153. 'list' => array
  154. (
  155. # 匹配的正则或函数 选填项
  156. 'option' => array
  157. (
  158. 'shop_id' => 'yes',
  159. 'area' => array('yes', 'like'),
  160. 'start_day' => array('yes-day', '>='),
  161. 'end_day' => array('yes-day', '<='),
  162. 'state' => 1,
  163. ),
  164. 'type' => 'all',
  165. 'order' => array('day' => 'desc', 'cdate' => 'desc'),
  166. 'page' => array(20, 'list'),
  167. 'group' => 'shop_id',
  168. 'col' => '*,sum(buy_num) as buy_num, sum(buy_cash) as buy_cash, sum(sell_num) as sell_num, sum(sell_cash) as sell_cash, sum(sl_num) as sl_num',
  169. ),
  170. ),
  171. );
  172. return $config;