cash.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  1. <?php
  2. $status = array
  3. (
  4. 1 => array('name' => '待审核', 'style' => 'font-weight:bold;color:#436EEE'),
  5. 2 => array('name' => '已审核', 'style' => 'font-weight:bold;color:green'),
  6. 3 => array('name' => '已作废', 'style' => 'font-weight:bold;color:#CD3700'),
  7. );
  8. $manage_status = array
  9. (
  10. //1 => '待审核',
  11. 2 => '已审核',
  12. 3 => '已作废',
  13. );
  14. $type = array
  15. (
  16. 1 => '直推佣金',
  17. 2 => '市场培训费',
  18. 3 => '区域管理收益',#'代理区域分润',
  19. 4 => '活动分佣',
  20. 10 => '手动发放',
  21. 11 => '提现',
  22. 12 => '消费',
  23. 13 => '区域招商补贴',
  24. 14 => '创V归店补贴',
  25. );
  26. $role = function()
  27. {
  28. $array = array();
  29. $data = Dever::load('setting/role-state');
  30. if($data)
  31. {
  32. $array += $data;
  33. }
  34. return $array;
  35. };
  36. $mid = Dever::input('search_option_mid');
  37. $button = array();
  38. if ($mid) {
  39. $button['返回上一页'] = array('location', 'l=project/database/list&project=agent&table=member_area&page_type=1&mid=' . $mid . '&[refer]');
  40. if (Dever::load('manage/auth')->checkFunc('agent.member', 'edit1', '发放资金')) {
  41. $button['发放资金'] = array('fast', '', 'push_cash&search_option_mid=' . $mid);
  42. }
  43. // $button = array
  44. // (
  45. // '返回上一页' => array('location', 'l=project/database/list&project=agent&table=member_area&page_type=1&mid=' . $mid),
  46. // '发放资金' => array('fast', '', 'push_cash&search_option_mid=' . $mid),
  47. // );
  48. }
  49. $excel = false;
  50. if(Dever::load('manage/auth')->checkFunc('menu_244.menu_245', 'editCout', '数据导出')){
  51. $excel[] = array('数据导出','代理商分润', 'bill/lib/cash.out_cash');
  52. }
  53. $list_button = array();
  54. $list_button['list'] = array('查看详情', '"push_cash&project=bill&id={id}&page_type=1&[refer]"');
  55. if (Dever::load('manage/auth')->checkFunc('bill.tixian', 'edit', '审核')) {
  56. $list_button['fast'] = array('审核', '"cash&where_id={id}&col=audit,audit_desc&oper_save_jump=cash&oper_table=cash&oper_parent=cash"', '{status} == 1');
  57. }
  58. $mul = false;
  59. if (Dever::load('manage/auth')->checkFunc('bill.tixian', 'tixianedit', '批量审核')) {
  60. $mul = '{status} == 1';
  61. }
  62. return array
  63. (
  64. # 表名
  65. 'name' => 'cash',
  66. # 显示给用户看的名称
  67. 'lang' => '资金流水',
  68. 'auto' => 100000,
  69. 'set' => array
  70. (
  71. 'status' => $status,
  72. 'type' => $type,
  73. ),
  74. 'start' => array
  75. (
  76. 'updatemul' => 'bill/lib/manage.cashAuditUpdateStart',
  77. ),
  78. 'end' => array
  79. (
  80. 'update' => 'bill/lib/manage.cashAuditUpdate',
  81. 'updatemul' => 'bill/lib/manage.cashAuditUpdate',
  82. ),
  83. 'order' => 99,
  84. # 数据结构
  85. 'struct' => array
  86. (
  87. 'id' => array
  88. (
  89. 'type' => 'int-11',
  90. 'name' => 'ID',
  91. 'default' => '',
  92. 'desc' => '',
  93. 'match' => 'is_numeric',
  94. 'search' => 'order',
  95. //'list' => true,
  96. ),
  97. 'mid' => array
  98. (
  99. 'type' => 'int-11',
  100. 'name' => '代理商姓名/手机号',
  101. 'default' => '-1',
  102. 'desc' => '代理商',
  103. 'match' => 'is_string',
  104. 'update' => 'text',
  105. 'search' => array
  106. (
  107. 'api' => 'agent/member-getSearch',
  108. 'col' => 'col',
  109. 'result' => 'id',
  110. 'search' => 'mid',
  111. ),
  112. 'list_name' => '代理商信息',
  113. 'list' => 'Dever::load("agent/lib/member.getOne", {mid}, "agent/member", true)',
  114. 'list_order' => 1,
  115. ),
  116. 'agent-member-name'=> array
  117. (
  118. 'name' => '姓名',
  119. 'default' => '',
  120. 'desc' => '姓名',
  121. 'match' => 'option',
  122. # 读取另外表的关联方式
  123. 'sync' => array('mid', 'id'),
  124. 'searchs' => array
  125. (
  126. 'api' => 'agent/member-find',
  127. 'col' => 'name',
  128. 'result' => 'id',
  129. ),
  130. ),
  131. 'agent-member-role'=> array
  132. (
  133. 'name' => '代理角色',
  134. 'default' => '',
  135. 'desc' => '代理角色',
  136. 'match' => 'option',
  137. # 读取另外表的关联方式
  138. 'sync' => array('mid', 'id'),
  139. // 'list' => 'Dever::load("setting/role-find#name", "{agent-member-role}")',
  140. // 'list_order' => 5,
  141. ),
  142. 'order_num' => array
  143. (
  144. 'type' => 'varchar-100',
  145. 'name' => '流水号',
  146. 'default' => '',
  147. 'desc' => '流水号',
  148. 'match' => 'is_string',
  149. 'update' => 'text',
  150. 'search' => 'fulltext',
  151. //'list' => true,
  152. //'list_name' => '流水号<br />交易时间',
  153. //'list' =>'Dever::load("bill/lib/cash.order_num#num", {id})',
  154. //'list_order' => 1,
  155. ),
  156. 'role' => array
  157. (
  158. 'type' => 'int-11',
  159. 'name' => '代理角色',
  160. 'default' => '',
  161. 'desc' => '代理角色',
  162. 'match' => 'is_numeric',
  163. //'search' => 'select',
  164. 'update' => 'checkbox',
  165. 'option' => $role,
  166. //'list' => true,
  167. ),
  168. 'type' => array
  169. (
  170. 'type' => 'int-11',
  171. 'name' => '交易类型',
  172. 'default' => '1',
  173. 'desc' => '交易类型',
  174. 'match' => 'is_numeric',
  175. 'search' => 'select',
  176. 'update' => 'checkbox',
  177. 'option' => $type,
  178. 'list' => true,
  179. 'list_order' => 2,
  180. ),
  181. 'type_id' => array
  182. (
  183. 'type' => 'int-11',
  184. 'name' => '交易来源id',
  185. 'default' => '',
  186. 'desc' => '交易来源id',
  187. 'match' => 'is_string',
  188. 'update' => 'text',
  189. ),
  190. 'cash' => array
  191. (
  192. 'type' => 'decimal-11,2',
  193. 'name' => '金额',
  194. 'default' => '0',
  195. 'desc' => '金额',
  196. 'match' => 'is_numeric',
  197. 'update' => 'text',
  198. 'list_name' => '金额<br />操作后余额',
  199. 'list' =>'Dever::load("bill/lib/cash.order_num#cash", {id})',
  200. 'list_order' => 4,
  201. ),
  202. 'yue' => array
  203. (
  204. 'type' => 'decimal-11,2',
  205. 'name' => '操作后余额',
  206. 'default' => '0',
  207. 'desc' => '操作后余额',
  208. 'match' => 'is_numeric',
  209. 'update' => 'text',
  210. // 'list' => true,
  211. // 'list_order' => 7,
  212. ),
  213. 'status' => array
  214. (
  215. 'type' => 'int-11',
  216. 'name' => '交易状态',
  217. 'default' => '1',
  218. 'desc' => '交易状态',
  219. 'match' => 'is_numeric',
  220. 'update' => 'hidden',
  221. 'option' => $status,
  222. 'search' => 'select',
  223. 'list' => true,
  224. 'list_name' => '交易状态',
  225. 'list_order' => 3,
  226. ),
  227. 'audit' => array
  228. (
  229. 'type' => 'int-11',
  230. 'name' => '审核状态',
  231. 'default' => '2',
  232. 'desc' => '审核状态',
  233. 'match' => 'is_numeric',
  234. 'update' => 'radio',
  235. 'option' => $manage_status,
  236. 'mul' => true,
  237. 'control' => 'audit',
  238. ),
  239. 'audit_desc' => array
  240. (
  241. 'type' => 'varchar-600',
  242. 'name' => '备注',
  243. 'default' => '',
  244. 'desc' => '审核说明',
  245. 'match' => 'is_string',
  246. 'update' => 'textarea',
  247. 'list' => '"{audit_desc}" ? "{audit_desc}" : "-"',
  248. 'list_order' => 5,
  249. 'show' => 'audit=3',
  250. ),
  251. 'desc' => array
  252. (
  253. 'type' => 'varchar-600',
  254. 'name' => '资金说明',
  255. 'default' => '',
  256. 'desc' => '资金说明',
  257. 'match' => 'is_string',
  258. 'update' => 'text',
  259. ),
  260. 'operdate' => array
  261. (
  262. 'type' => 'int-11',
  263. 'name' => '审核确认时间',
  264. 'default' => '',
  265. 'match' => 'is_numeric',
  266. 'desc' => '',
  267. //'list' => '"{operdate}" > 0 ? date("Y-m-d H:i", {operdate}) : "-"',
  268. //'list_order' => 9,
  269. ),
  270. 'state' => array
  271. (
  272. 'type' => 'tinyint-1',
  273. 'name' => '状态',
  274. 'default' => '1',
  275. 'desc' => '请选择状态',
  276. 'match' => 'is_numeric',
  277. ),
  278. 'cdate' => array
  279. (
  280. 'type' => 'int-11',
  281. 'name' => '交易时间',
  282. 'match' => array('is_numeric', time()),
  283. 'desc' => '',
  284. # 只有insert时才生效
  285. 'insert' => true,
  286. 'search' => 'date',
  287. 'list_name' => '交易时间<br />审核时间',
  288. 'list' => 'Dever::load("bill/lib/cash.order_num#num", {id})',
  289. 'list_order' => 20,
  290. ),
  291. ),
  292. 'manage' => array
  293. (
  294. 'insert' => false,
  295. 'delete' => false,
  296. 'edit' => false,
  297. 'excel' => $excel,
  298. 'button' => $button,
  299. 'mul' => $mul,
  300. 'list_button' => $list_button,
  301. ),
  302. 'request' => array
  303. (
  304. 'getData' => array
  305. (
  306. # 匹配的正则或函数 选填项
  307. 'option' => array
  308. (
  309. 'mid' => 'yes',
  310. 'type' => 'yes',
  311. 'state' => 1,
  312. ),
  313. 'order' => array('id' => 'desc'),
  314. 'page' => array(10, 'list'),
  315. 'type' => 'all',
  316. 'col' => '*',
  317. ),
  318. # 获取订单数量
  319. 'getCash' => array
  320. (
  321. # 匹配的正则或函数 选填项
  322. 'option' => array
  323. (
  324. 'start' => array('yes-cdate', '>='),
  325. 'end' => array('yes-cdate', '<='),
  326. 'type' => array('yes', 'in'),
  327. 'mid' => 'yes',
  328. 'status' => 2,
  329. 'state' => 1,
  330. ),
  331. 'type' => 'one',
  332. 'col' => 'sum(cash) as total',
  333. ),
  334. 'getwsCash' => array
  335. (
  336. # 匹配的正则或函数 选填项
  337. 'option' => array
  338. (
  339. 'start' => array('yes-cdate', '>='),
  340. 'end' => array('yes-cdate', '<='),
  341. 'status' => array('yes', 'in'),
  342. 'type' => array('yes', 'in'),
  343. 'mid' => 'yes',
  344. 'state' => 1,
  345. ),
  346. 'type' => 'one',
  347. 'col' => 'sum(cash) as total',
  348. ),
  349. 'getExcelAll' => array
  350. (
  351. # 匹配的正则或函数 选填项
  352. 'option' => array
  353. (
  354. 'start' => array('yes-cdate', '>='),
  355. 'end' => array('yes-cdate', '<='),
  356. 'state' => 1,
  357. ),
  358. 'type' => 'all',
  359. 'col' => '*',
  360. ),
  361. ),
  362. );