area_stat.php 9.4 KB

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