cash.php 12 KB

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