cash.php 11 KB

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