shop_stat.php 7.3 KB

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