shop_stat.php 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. <?php
  2. $button = array();
  3. if (Dever::load('manage/auth')->checkFunc('bill.shop_stat', 'editSout', '导出数据')) {
  4. $button['数据导出'] = array('excel','bill/lib/manage.out_shop_stat');
  5. }
  6. $shop = function()
  7. {
  8. $array = array();
  9. $data = Dever::db('shop/info-state');
  10. if($data)
  11. {
  12. $array += $data;
  13. }
  14. return $array;
  15. };
  16. $list_button = array();
  17. $list_button['list1'] = array('查看明细', 'project/database/list&project=agent&table=member_shop_log&menu=agent&search_option_state=1&menu_id=306&search_option_new_shop_id={shop_id}&search_option_dever_auth=2');
  18. $config = array
  19. (
  20. # 表名
  21. 'name' => 'shop_stat',
  22. # 显示给用户看的名称
  23. 'lang' => '归店统计',
  24. 'order' => -10,
  25. # 数据结构 不同的字段放这里
  26. 'struct' => array
  27. (
  28. 'id' => array
  29. (
  30. 'type' => 'int-11',
  31. 'name' => 'ID',
  32. 'default' => '',
  33. 'desc' => '',
  34. 'match' => 'is_numeric',
  35. //'list' => true,
  36. ),
  37. 'month' => array
  38. (
  39. 'type' => 'int-11',
  40. 'name' => '月份',
  41. 'default' => '',
  42. 'match' => 'is_numeric',
  43. 'desc' => '',
  44. 'search' => 'month',
  45. 'list' => 'date("Y-m", {month})',
  46. 'list_order' => 1,
  47. ),
  48. 'mids' => array
  49. (
  50. 'type' => 'text-255',
  51. 'name' => '代理商id',
  52. 'default' => '',
  53. 'desc' => '代理商id',
  54. 'match' => 'is_numeric',
  55. // 'option' => $shop,
  56. // 'list' => true,
  57. //'list_order' => 6,
  58. ),
  59. 'shop_id' => array
  60. (
  61. 'type' => 'int-11',
  62. 'name' => '店铺名称',
  63. 'default' => '',
  64. 'desc' => '店铺名称',
  65. 'match' => 'is_numeric',
  66. 'option' => $shop,
  67. 'list_name' => '门店名称<br/>门店编号<br/>所属代理商',
  68. 'list' => 'Dever::load("bill/lib/manage.shop_stat", {id})',
  69. 'list_order' => 2,
  70. ),
  71. 'c_money' => array
  72. (
  73. 'type' => 'decimal-11,2',
  74. 'name' => '采购金额',
  75. 'default' => '0',
  76. 'desc' => '采购金额',
  77. 'match' => 'is_numeric',
  78. 'update' => 'text',
  79. 'list' => true,
  80. 'list_order' => 3,
  81. ),
  82. 'num' => array
  83. (
  84. 'type' => 'int-11',
  85. 'name' => '代理商总数量',
  86. 'default' => '0',
  87. 'desc' => '代理商总数量',
  88. 'match' => 'is_numeric',
  89. 'search' => 'order',
  90. // 'list' => true,
  91. ),
  92. 'dl_num' => array
  93. (
  94. 'type' => 'int-11',
  95. 'name' => '代理商<br/>数量-除掉创v的数量',
  96. 'default' => '0',
  97. 'desc' => '代理商数量',
  98. 'match' => 'is_numeric',
  99. // 'search' => 'order',
  100. 'list' => true,
  101. ),
  102. 'ck_num' => array
  103. (
  104. 'type' => 'int-11',
  105. 'name' => '创客数',
  106. 'default' => '0',
  107. 'desc' => '创客数',
  108. 'match' => 'is_numeric',
  109. // 'search' => 'order',
  110. 'list' => true,
  111. 'list_order' => 5,
  112. ),
  113. 'v_num' => array
  114. (
  115. 'type' => 'int-11',
  116. 'name' => '创V数',
  117. 'default' => '0',
  118. 'desc' => '创V总数量',
  119. 'match' => 'is_numeric',
  120. // 'search' => 'order',
  121. 'list' => true,
  122. 'list_order' => 6,
  123. ),
  124. 'out_num' => array
  125. (
  126. 'type' => 'int-11',
  127. 'name' => '名额外创V',
  128. 'default' => '0',
  129. 'desc' => '创V名额外数量',
  130. 'match' => 'is_numeric',
  131. // 'search' => 'order',
  132. 'list' => true,
  133. 'list_order' => 7,
  134. ),
  135. 'money' => array
  136. (
  137. 'type' => 'decimal-11,2',
  138. 'name' => '代理商的总业绩',
  139. 'default' => '0',
  140. 'desc' => '代理商的总业绩',
  141. 'match' => 'is_numeric',
  142. 'update' => 'text',
  143. // 'list' => true,
  144. ),
  145. 'dl_money' => array
  146. (
  147. 'type' => 'decimal-11,2',
  148. 'name' => '归店业绩<br/>(除创V)',
  149. 'default' => '0',
  150. 'desc' => '代理商业绩',
  151. 'match' => 'is_numeric',
  152. 'update' => 'text',
  153. 'list' => true,
  154. 'list_order' => 4,
  155. ),
  156. 'v_money' => array
  157. (
  158. 'type' => 'decimal-11,2',
  159. 'name' => '创V总业绩',
  160. 'default' => '0',
  161. 'desc' => '创V总业绩',
  162. 'match' => 'is_numeric',
  163. 'update' => 'text',
  164. // 'list' => true,
  165. ),
  166. 'out_money' => array
  167. (
  168. 'type' => 'decimal-11,2',
  169. 'name' => '名额外创V<br/>业绩',
  170. 'default' => '0',
  171. 'desc' => '创V名额外业绩',
  172. 'match' => 'is_numeric',
  173. 'update' => 'text',
  174. 'list' => true,
  175. 'list_order' => 8,
  176. ),
  177. 'state' => array
  178. (
  179. 'type' => 'tinyint-1',
  180. 'name' => '数据状态',
  181. 'default' => '1',
  182. 'desc' => '请选择状态',
  183. 'match' => 'is_numeric',
  184. ),
  185. 'cdate' => array
  186. (
  187. 'type' => 'int-11',
  188. 'name' => '发布时间',
  189. 'match' => array('is_numeric', time()),
  190. 'desc' => '',
  191. # 只有insert时才生效
  192. 'insert' => true,
  193. //'search' => 'date',
  194. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  195. ),
  196. ),
  197. 'manage' => array
  198. (
  199. 'insert' => false,
  200. 'edit' => false,
  201. 'delete' => false,
  202. // 'excel' => $excel,
  203. 'button' => $button,
  204. 'list_button' => $list_button,
  205. // (
  206. // 'new' => array('查看明细', '"lib/manage.guidian?id={id}"', 'bill'),
  207. // ),
  208. ),
  209. # request 请求接口定义
  210. 'request' => array
  211. (
  212. 'getExcelAll' => array
  213. (
  214. # 匹配的正则或函数 选填项
  215. 'option' => array
  216. (
  217. 'start' => array('yes-month', '>='),
  218. 'end' => array('yes-month', '<='),
  219. 'state' => 1,
  220. ),
  221. 'type' => 'all',
  222. 'col' => '*',
  223. ),
  224. ),
  225. );
  226. return $config;