shop_stat.php 8.4 KB

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