cash.php 12 KB

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