shop_stat.php 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  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' => 'day',
  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. 'shop_id' => array
  63. (
  64. 'type' => 'int-11',
  65. 'name' => '店铺名称/店铺编号',
  66. 'default' => '',
  67. 'desc' => '店铺名称',
  68. 'match' => 'is_numeric',
  69. 'option' => $shop,
  70. 'search' => array
  71. (
  72. 'api' => 'shop/info-getSearch',
  73. 'col' => 'col',
  74. 'result' => 'id',
  75. ) ,
  76. 'list_name' => '门店名称<br/>门店编号<br/>所属代理商',
  77. 'list' => 'Dever::load("bill/lib/manage.shop_stat", {id})',
  78. 'list_order' => 2,
  79. ),
  80. 'c_money' => array
  81. (
  82. 'type' => 'decimal-11,2',
  83. 'name' => '采购金额',
  84. 'default' => '0',
  85. 'desc' => '采购金额',
  86. 'match' => 'is_numeric',
  87. 'update' => 'text',
  88. 'list' => true,
  89. 'list_order' => 3,
  90. ),
  91. 'num' => array
  92. (
  93. 'type' => 'int-11',
  94. 'name' => '代理商总数量',
  95. 'default' => '0',
  96. 'desc' => '代理商总数量',
  97. 'match' => 'is_numeric',
  98. 'search' => 'order',
  99. // 'list' => true,
  100. ),
  101. 'dl_num' => array
  102. (
  103. 'type' => 'int-11',
  104. 'name' => '代理商<br/>数量-除掉创v的数量',
  105. 'default' => '0',
  106. 'desc' => '代理商数量',
  107. 'match' => 'is_numeric',
  108. // 'search' => 'order',
  109. 'list' => true,
  110. ),
  111. 'ck_num' => array
  112. (
  113. 'type' => 'int-11',
  114. 'name' => '创客数',
  115. 'default' => '0',
  116. 'desc' => '创客数',
  117. 'match' => 'is_numeric',
  118. // 'search' => 'order',
  119. 'list' => true,
  120. 'list_order' => 5,
  121. ),
  122. 'v_num' => array
  123. (
  124. 'type' => 'int-11',
  125. 'name' => '创V数',
  126. 'default' => '0',
  127. 'desc' => '创V总数量',
  128. 'match' => 'is_numeric',
  129. // 'search' => 'order',
  130. 'list' => true,
  131. 'list_order' => 6,
  132. ),
  133. 'out_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' => 7,
  143. ),
  144. 'money' => array
  145. (
  146. 'type' => 'decimal-11,2',
  147. 'name' => '代理商的总业绩',
  148. 'default' => '0',
  149. 'desc' => '代理商的总业绩',
  150. 'match' => 'is_numeric',
  151. 'update' => 'text',
  152. // 'list' => true,
  153. ),
  154. 'dl_money' => array
  155. (
  156. 'type' => 'decimal-11,2',
  157. 'name' => '归店业绩<br/>(除创V)',
  158. 'default' => '0',
  159. 'desc' => '代理商业绩',
  160. 'match' => 'is_numeric',
  161. 'update' => 'text',
  162. 'list' => true,
  163. 'list_order' => 4,
  164. ),
  165. 'v_money' => array
  166. (
  167. 'type' => 'decimal-11,2',
  168. 'name' => '创V总业绩',
  169. 'default' => '0',
  170. 'desc' => '创V总业绩',
  171. 'match' => 'is_numeric',
  172. 'update' => 'text',
  173. // 'list' => true,
  174. ),
  175. 'out_money' => array
  176. (
  177. 'type' => 'decimal-11,2',
  178. 'name' => '名额外创V<br/>业绩',
  179. 'default' => '0',
  180. 'desc' => '创V名额外业绩',
  181. 'match' => 'is_numeric',
  182. 'update' => 'text',
  183. 'list' => true,
  184. 'list_order' => 8,
  185. ),
  186. 'state' => array
  187. (
  188. 'type' => 'tinyint-1',
  189. 'name' => '数据状态',
  190. 'default' => '1',
  191. 'desc' => '请选择状态',
  192. 'match' => 'is_numeric',
  193. ),
  194. 'cdate' => array
  195. (
  196. 'type' => 'int-11',
  197. 'name' => '发布时间',
  198. 'match' => array('is_numeric', time()),
  199. 'desc' => '',
  200. # 只有insert时才生效
  201. 'insert' => true,
  202. //'search' => 'date',
  203. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  204. ),
  205. ),
  206. 'manage' => array
  207. (
  208. 'insert' => false,
  209. 'edit' => false,
  210. 'delete' => false,
  211. 'excel' => $excel,
  212. 'button' => $button,
  213. 'list_button' => $list_button,
  214. // (
  215. // 'new' => array('查看明细', '"lib/manage.guidian?id={id}"', 'bill'),
  216. // ),
  217. ),
  218. # request 请求接口定义
  219. 'request' => array
  220. (
  221. 'getState' => array
  222. (
  223. # 匹配的正则或函数 选填项
  224. 'option' => array
  225. (
  226. 'start' => array('yes-month', '>='),
  227. 'end' => array('yes-month', '<='),
  228. 'shop_id' => 'yes',
  229. 'state' => 1,
  230. ),
  231. 'type' => 'all',
  232. 'col' => '*',
  233. ),
  234. ),
  235. );
  236. return $config;