area_stat.php 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. <?php
  2. $status = array
  3. (
  4. 1 => '已确认',
  5. 2 => '未确认',
  6. );
  7. $cash_status = array
  8. (
  9. 1 => '已发放',
  10. 2 => '未发放',
  11. );
  12. $type = array
  13. (
  14. 1 => '城市',
  15. 2 => '区县',
  16. 3 => '街道',
  17. );
  18. $desc = '';
  19. $month = Dever::input('search_option_month', date('Y-m'));
  20. if ($month) {
  21. Dever::setInput('search_option_month', $month);
  22. }
  23. $button = array();
  24. $button['一键生成区域分润'] = array('oper', 'mail/?l=lib/manage.area&day=' . $month, '确认生成区域分润信息吗?');
  25. $button['对账确认'] = array('oper', 'mail/?l=lib/manage.areaYes_commit&month=' . $month, '确定已完成对账?');
  26. $button['确认发放'] = array('oper', 'mail/?l=lib/manage.areaCash_commit&month=' . $month, '确认发放资金到代理商账户吗?确认后无法手动恢复');
  27. return array
  28. (
  29. # 表名
  30. 'name' => 'area_stat',
  31. # 显示给用户看的名称
  32. 'lang' => '区域分润处理',
  33. 'order' => 79,
  34. 'menu' => 'agent',
  35. 'info' => '',
  36. 'desc' => '满足以下条件才可显示:1.区域下必须有门店;2.区域内代理商分润金额不为0;3.零售店、体验店全部处于合作中状态',
  37. 'end' => array
  38. (
  39. 'list' => 'mail/lib/manage.getAreaInfo',
  40. ),
  41. # 数据结构
  42. 'struct' => array
  43. (
  44. 'id' => array
  45. (
  46. 'type' => 'int-11',
  47. 'name' => 'ID',
  48. 'default' => '',
  49. 'desc' => '',
  50. 'match' => 'is_numeric',
  51. 'search' => 'order',
  52. //'list' => true,
  53. ),
  54. 'month' => array
  55. (
  56. 'type' => 'int-11',
  57. 'name' => '选择月份',
  58. 'default' => '',
  59. 'match' => 'is_numeric',
  60. 'desc' => '',
  61. 'update' => 'month',
  62. 'search' => 'month_eq',
  63. 'search_default' => '',
  64. 'list_name' => '月份',
  65. 'list' => 'date("Y-m", {month})',
  66. ),
  67. 'name' => array
  68. (
  69. 'type' => 'varchar-500',
  70. 'name' => '区域',
  71. 'default' => '',
  72. 'desc' => '区域',
  73. 'match' => 'option',
  74. 'update' => 'linkage',
  75. //'search' => 'linkage',
  76. 'list' => 'Dever::load("mail/lib/manage.getArea", "{name}")',
  77. 'option' => Dever::url('api.get?level_total=4', 'area'),
  78. ),
  79. 'type' => array
  80. (
  81. 'type' => 'int-11',
  82. 'name' => '区域类型',
  83. 'default' => '1',
  84. 'desc' => '区域类型',
  85. 'match' => 'is_numeric',
  86. 'option' => $type,
  87. ),
  88. 'parent_id' => array
  89. (
  90. 'type' => 'int-11',
  91. 'name' => '上级id',
  92. 'default' => -1,
  93. 'desc' => '请选择上级id',
  94. 'match' => 'is_numeric',
  95. ),
  96. 't_cash' => array
  97. (
  98. 'type' => 'decimal-11,2',
  99. 'name' => '体验店分润金额',
  100. 'default' => '0',
  101. 'desc' => '体验店分润金额',
  102. 'match' => 'is_numeric',
  103. // 'update' => 'text',
  104. 'list' => true,
  105. ),
  106. 'l_cash' => array
  107. (
  108. 'type' => 'decimal-11,2',
  109. 'name' => '零售店分润金额',
  110. 'default' => '0',
  111. 'desc' => '零售店分润金额',
  112. 'match' => 'is_numeric',
  113. // 'update' => 'text',
  114. 'list' => true,
  115. ),
  116. 't_num' => array
  117. (
  118. 'type' => 'int-11',
  119. 'name' => '体验店数量',
  120. 'default' => '0',
  121. 'desc' => '体验店数量',
  122. 'match' => 'is_numeric',
  123. // 'update' => 'text',
  124. 'list' => true,
  125. ),
  126. 'l_num' => array
  127. (
  128. 'type' => 'int-11',
  129. 'name' => '零售店数量',
  130. 'default' => '0',
  131. 'desc' => '零售店数量',
  132. 'match' => 'is_numeric',
  133. // 'update' => 'text',
  134. 'list' => true,
  135. ),
  136. 't_buy' => 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. 'l_buy' => array
  147. (
  148. 'type' => 'decimal-11,2',
  149. 'name' => '零售店采购毛利',
  150. 'default' => '0',
  151. 'desc' => '零售店采购毛利',
  152. 'match' => 'is_numeric',
  153. // 'update' => 'text',
  154. 'list' => true,
  155. ),
  156. 'mid' => array
  157. (
  158. 'type' => 'int-11',
  159. 'name' => '收益代理商姓名/电话',
  160. 'default' => '-1',
  161. 'desc' => '代理商',
  162. 'match' => 'is_string',
  163. // 'update' => 'text',
  164. 'searchs' => array
  165. (
  166. 'api' => 'agent/member-getSearch',
  167. 'col' => 'col',
  168. 'result' => 'id',
  169. 'search' => 'mid',
  170. ),
  171. 'list_name' => '收益代理商',
  172. 'list' => 'Dever::load("mail/lib/manage.area_member", {id})',
  173. ),
  174. 'status' => array
  175. (
  176. 'type' => 'int-11',
  177. 'name' => '确认状态',
  178. 'default' => '2',
  179. 'desc' => '确认状态',
  180. 'match' => 'is_numeric',
  181. 'option' => $status,
  182. 'list' => true,
  183. ),
  184. 'cash_status' => array
  185. (
  186. 'type' => 'int-11',
  187. 'name' => '发放状态',
  188. 'default' => '2',
  189. 'desc' => '发放状态',
  190. 'match' => 'is_numeric',
  191. 'option' => $cash_status,
  192. 'list' => true,
  193. ),
  194. 'data' => array
  195. (
  196. 'type' => 'text-255',
  197. 'name' => '明细数据',
  198. 'default' => '',
  199. 'desc' => '明细数据',
  200. 'match' => 'is_string',
  201. ),
  202. 'state' => array
  203. (
  204. 'type' => 'tinyint-1',
  205. 'name' => '状态',
  206. 'default' => '1',
  207. 'desc' => '请选择状态',
  208. 'match' => 'is_numeric',
  209. ),
  210. 'cdate' => array
  211. (
  212. 'type' => 'int-11',
  213. 'name' => '统计时间',
  214. 'match' => array('is_numeric', time()),
  215. 'desc' => '',
  216. ),
  217. ),
  218. 'manage' => array
  219. (
  220. 'insert' => false,
  221. 'delete' => false,
  222. 'edit' => false,
  223. 'excel' => true,
  224. 'list_type' => 'tree',
  225. 'button' => $button,
  226. ),
  227. 'request' => array
  228. (
  229. 'getData' => array
  230. (
  231. # 匹配的正则或函数 选填项
  232. 'option' => array
  233. (
  234. 'mid' => 'yes',
  235. 'month' => 'yes',
  236. 'state' => 1,
  237. ),
  238. 'order' => array('id' => 'desc'),
  239. 'page' => array(10, 'list'),
  240. 'type' => 'all',
  241. 'col' => '*',
  242. ),
  243. 'prev' => array
  244. (
  245. # 匹配的正则或函数 选填项
  246. 'option' => array
  247. (
  248. 'month' => array('yes-month', '<'),
  249. 'mid' => 'yes',
  250. 'state' => 1,
  251. ),
  252. 'order' => array('time' => 'desc', 'id' => 'desc'),
  253. 'type' => 'one',
  254. 'col' => '*,min(month) as time, sum(num) as num',
  255. # 允许自定义以上配置
  256. 'config' => true,
  257. ),
  258. 'getOne' => array
  259. (
  260. # 匹配的正则或函数 选填项
  261. 'option' => array
  262. (
  263. 'mid' => 'yes',
  264. 'state' => 1,
  265. ),
  266. 'type' => 'count',
  267. 'col' => '*',
  268. ),
  269. 'getData' => array
  270. (
  271. # 匹配的正则或函数 选填项
  272. 'option' => array
  273. (
  274. 'mid' => 'yes',
  275. 'state' => 1,
  276. ),
  277. 'type' => 'all',
  278. 'order' => array('month' => 'desc', 'id' => 'desc'),
  279. 'page' => array(20, 'list'),
  280. 'col' => '*',
  281. ),
  282. ),
  283. );