sell_stat.php 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <?php
  2. $shop = function()
  3. {
  4. $array = array();
  5. $info = Dever::db('shop/info')->select();
  6. if($info)
  7. {
  8. $array += $info;
  9. }
  10. return $array;
  11. };
  12. return array
  13. (
  14. # 表名
  15. 'name' => 'sell_stat',
  16. # 显示给用户看的名称
  17. 'lang' => '销售额统计',
  18. 'order' => -9,
  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. 'search' => 'order',
  30. //'list' => true,
  31. ),
  32. 'day' => array
  33. (
  34. 'type' => 'int-11',
  35. 'name' => '日期',
  36. 'default' => '',
  37. 'match' => 'is_numeric',
  38. 'desc' => '',
  39. 'search' => 'day',
  40. 'search_button' => array
  41. (
  42. 'sum' => 'cash,`order`,goods',
  43. 'option' => array(
  44. 'day' => '按天',
  45. 'week' => '按周',
  46. 'month' => '按月',
  47. ),
  48. 'group' => 'shop_id',
  49. ),
  50. 'order' => 'desc',
  51. 'list' => 'Dever::showDay("{day}")',
  52. ),
  53. 'shop_id' => array
  54. (
  55. 'type' => 'int-11',
  56. 'name' => '门店名称',
  57. 'default' => '',
  58. 'desc' => '门店名称',
  59. 'match' => 'is_numeric',
  60. 'search' => 'select',
  61. //'option' => $shop,
  62. 'update' => 'hidden',
  63. 'search' => 'hidden',
  64. 'search' => array
  65. (
  66. 'api' => 'shop/info-like',
  67. 'col' => 'name',
  68. 'result' => 'id',
  69. ),
  70. 'value' => Dever::input('search_option_shop_id'),
  71. 'list' => 'Dever::load("shop/info-one#name", {shop_id})',
  72. ),
  73. 'area' => array
  74. (
  75. 'type' => 'varchar-500',
  76. 'name' => '所在街道',
  77. 'default' => '',
  78. 'desc' => '所在街道',
  79. 'match' => 'option',
  80. 'search' => 'linkage',
  81. 'update' => 'linkage',
  82. 'option' => Dever::url('lib/area.get', 'shop'),
  83. //'list' => 'Dever::load("area/api.string", "{area}")',
  84. ),
  85. 'province' => array
  86. (
  87. 'type' => 'int-11',
  88. 'name' => '省份',
  89. 'default' => '',
  90. 'desc' => '省份',
  91. 'match' => 'option',
  92. //'update' => 'text',
  93. ),
  94. 'city' => array
  95. (
  96. 'type' => 'int-11',
  97. 'name' => '城市',
  98. 'default' => '',
  99. 'desc' => '城市',
  100. 'match' => 'option',
  101. //'update' => 'text',
  102. ),
  103. 'county' => array
  104. (
  105. 'type' => 'int-11',
  106. 'name' => '县区',
  107. 'default' => '',
  108. 'desc' => '县区',
  109. 'match' => 'option',
  110. //'update' => 'text',
  111. ),
  112. 'town' => array
  113. (
  114. 'type' => 'int-11',
  115. 'name' => '街道',
  116. 'default' => '',
  117. 'desc' => '街道',
  118. 'match' => 'option',
  119. //'update' => 'text',
  120. ),
  121. 'order' => array
  122. (
  123. 'type' => 'varchar-100',
  124. 'name' => '订单量',
  125. 'default' => '0',
  126. 'desc' => '订单量',
  127. 'match' => 'option',
  128. 'update' => 'text',
  129. 'list' => true,
  130. ),
  131. 'goods' => array
  132. (
  133. 'type' => 'varchar-100',
  134. 'name' => '商品数量',
  135. 'default' => '0',
  136. 'desc' => '商品数',
  137. 'match' => 'option',
  138. 'update' => 'text',
  139. 'list' => true,
  140. ),
  141. 'cash' => array
  142. (
  143. 'type' => 'varchar-100',
  144. 'name' => '营业额',
  145. 'default' => '0',
  146. 'desc' => '销售额',
  147. 'match' => 'option',
  148. 'update' => 'text',
  149. 'list' => true,
  150. ),
  151. 'state' => array
  152. (
  153. 'type' => 'tinyint-1',
  154. 'name' => '状态',
  155. 'default' => '1',
  156. 'desc' => '请选择状态',
  157. 'match' => 'is_numeric',
  158. ),
  159. 'cdate' => array
  160. (
  161. 'type' => 'int-11',
  162. 'name' => '生成时间',
  163. 'match' => array('is_numeric', time()),
  164. 'desc' => '',
  165. # 只有insert时才生效
  166. 'insert' => true,
  167. //'search' => 'date',
  168. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  169. //'list' => 'Dever::load("service/lib/manage.showOrderTime", "{id}")',
  170. ),
  171. ),
  172. 'manage' => array
  173. (
  174. 'delete' => false,
  175. 'edit' => false,
  176. 'insert' => false,
  177. 'excel' => true,
  178. ),
  179. 'request' => array
  180. (
  181. # 获取总金额
  182. 'getAll' => array
  183. (
  184. # 匹配的正则或函数 选填项
  185. 'option' => array
  186. (
  187. 'start' => array('yes-day', '>='),
  188. 'end' => array('yes-day', '<='),
  189. 'shop_id' => 'yes',
  190. 'state' => 1,
  191. ),
  192. 'type' => 'all',
  193. 'col' => '*',
  194. ),
  195. ),
  196. );