cash.php 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. <?php
  2. $status = array
  3. (
  4. 1 => '待审核',
  5. 2 => '已审核',
  6. 3 => '已作废',
  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. );
  23. $role = function()
  24. {
  25. $array = array();
  26. $data = Dever::load('setting/role-state');
  27. if($data)
  28. {
  29. $array += $data;
  30. }
  31. return $array;
  32. };
  33. $mid = Dever::input('search_option_mid');
  34. $button = array();
  35. if ($mid) {
  36. $button = array
  37. (
  38. '返回上一页' => array('location', 'l=project/database/list&project=agent&table=member_area&page_type=1&mid=' . $mid),
  39. '发放资金' => array('fast', '', 'push_cash&search_option_mid=' . $mid),
  40. );
  41. }
  42. return array
  43. (
  44. # 表名
  45. 'name' => 'cash',
  46. # 显示给用户看的名称
  47. 'lang' => '资金流水',
  48. 'set' => array
  49. (
  50. 'status' => $status,
  51. 'type' => $type,
  52. ),
  53. 'end' => array
  54. (
  55. 'update' => 'bill/lib/manage.cashAuditUpdate',
  56. ),
  57. 'order' => 99,
  58. # 数据结构
  59. 'struct' => array
  60. (
  61. 'id' => array
  62. (
  63. 'type' => 'int-11',
  64. 'name' => 'ID',
  65. 'default' => '',
  66. 'desc' => '',
  67. 'match' => 'is_numeric',
  68. 'search' => 'order',
  69. //'list' => true,
  70. ),
  71. 'mid' => array
  72. (
  73. 'type' => 'int-11',
  74. 'name' => '手机号',
  75. 'default' => '-1',
  76. 'desc' => '代理商',
  77. 'match' => 'is_string',
  78. 'update' => 'text',
  79. 'search' => $mid ? 'hidden' : array
  80. (
  81. 'api' => 'agent/member-find',
  82. 'col' => 'mobile',
  83. 'result' => 'id',
  84. ),
  85. 'list_name' => '手机号',
  86. 'list' => 'Dever::load("agent/member-find#mobile", {mid})',
  87. 'list_order' => 4,
  88. ),
  89. 'agent-member-name'=> array
  90. (
  91. 'name' => '姓名',
  92. 'default' => '',
  93. 'desc' => '姓名',
  94. 'match' => 'option',
  95. # 读取另外表的关联方式
  96. 'sync' => array('mid', 'id'),
  97. 'list' => true,
  98. 'list_order' => 3,
  99. ),
  100. 'agent-member-role'=> array
  101. (
  102. 'name' => '代理角色',
  103. 'default' => '',
  104. 'desc' => '代理角色',
  105. 'match' => 'option',
  106. # 读取另外表的关联方式
  107. 'sync' => array('mid', 'id'),
  108. 'list' => 'Dever::load("setting/role-find#name", "{agent-member-role}")',
  109. 'list_order' => 5,
  110. ),
  111. 'order_num' => array
  112. (
  113. 'type' => 'varchar-100',
  114. 'name' => '流水号',
  115. 'default' => '',
  116. 'desc' => '流水号',
  117. 'match' => 'is_string',
  118. 'update' => 'text',
  119. 'search' => 'fulltext',
  120. 'list' => true,
  121. 'list_order' => 1,
  122. ),
  123. 'role' => array
  124. (
  125. 'type' => 'int-11',
  126. 'name' => '代理角色',
  127. 'default' => '',
  128. 'desc' => '代理角色',
  129. 'match' => 'is_numeric',
  130. //'search' => 'select',
  131. 'update' => 'checkbox',
  132. 'option' => $role,
  133. //'list' => true,
  134. ),
  135. 'type' => array
  136. (
  137. 'type' => 'int-11',
  138. 'name' => '交易类型',
  139. 'default' => '1',
  140. 'desc' => '交易类型',
  141. 'match' => 'is_numeric',
  142. 'search' => 'select',
  143. 'update' => 'checkbox',
  144. 'option' => $type,
  145. 'list' => true,
  146. 'list_order' => 7,
  147. ),
  148. 'type_id' => array
  149. (
  150. 'type' => 'int-11',
  151. 'name' => '交易来源id',
  152. 'default' => '',
  153. 'desc' => '交易来源id',
  154. 'match' => 'is_string',
  155. 'update' => 'text',
  156. ),
  157. 'cash' => array
  158. (
  159. 'type' => 'float-11,2',
  160. 'name' => '金额',
  161. 'default' => '0',
  162. 'desc' => '金额',
  163. 'match' => 'is_numeric',
  164. 'update' => 'text',
  165. 'list' => true,
  166. 'list_order' => 6,
  167. ),
  168. 'yue' => array
  169. (
  170. 'type' => 'float-11,2',
  171. 'name' => '操作后余额',
  172. 'default' => '0',
  173. 'desc' => '操作后余额',
  174. 'match' => 'is_numeric',
  175. 'update' => 'text',
  176. 'list' => true,
  177. 'list_order' => 7,
  178. ),
  179. 'status' => array
  180. (
  181. 'type' => 'int-11',
  182. 'name' => '交易状态',
  183. 'default' => '1',
  184. 'desc' => '交易状态',
  185. 'match' => 'is_numeric',
  186. 'update' => 'hidden',
  187. 'option' => $status,
  188. 'search' => 'select',
  189. 'list' => true,
  190. 'list_name' => '交易状态',
  191. 'list_order' => 8,
  192. ),
  193. 'audit' => array
  194. (
  195. 'type' => 'int-11',
  196. 'name' => '审核状态',
  197. 'default' => '2',
  198. 'desc' => '审核状态',
  199. 'match' => 'is_numeric',
  200. 'update' => 'radio',
  201. 'option' => $manage_status,
  202. 'mul' => true,
  203. ),
  204. 'audit_desc' => array
  205. (
  206. 'type' => 'varchar-600',
  207. 'name' => '备注',
  208. 'default' => '',
  209. 'desc' => '审核说明',
  210. 'match' => 'option',
  211. 'update' => 'textarea',
  212. 'list' => '"{audit_desc}" ? "{audit_desc}" : "-"',
  213. 'list_order' => 9,
  214. ),
  215. 'desc' => array
  216. (
  217. 'type' => 'varchar-600',
  218. 'name' => '资金说明',
  219. 'default' => '',
  220. 'desc' => '资金说明',
  221. 'match' => 'is_string',
  222. 'update' => 'text',
  223. ),
  224. 'operdate' => array
  225. (
  226. 'type' => 'int-11',
  227. 'name' => '审核确认时间',
  228. 'default' => '',
  229. 'match' => 'is_numeric',
  230. 'desc' => '',
  231. 'list' => '"{operdate}" > 0 ? date("Y-m-d H:i", {operdate}) : "-"',
  232. 'list_order' => 9,
  233. ),
  234. 'state' => array
  235. (
  236. 'type' => 'tinyint-1',
  237. 'name' => '状态',
  238. 'default' => '1',
  239. 'desc' => '请选择状态',
  240. 'match' => 'is_numeric',
  241. ),
  242. 'cdate' => array
  243. (
  244. 'type' => 'int-11',
  245. 'name' => '交易时间',
  246. 'match' => array('is_numeric', time()),
  247. 'desc' => '',
  248. # 只有insert时才生效
  249. //'insert' => true,
  250. 'search' => 'date',
  251. 'list' => 'date("Y-m-d H:i", {cdate})',
  252. 'list_order' => 2,
  253. ),
  254. ),
  255. 'manage' => array
  256. (
  257. 'insert' => false,
  258. 'delete' => false,
  259. 'edit' => false,
  260. 'button' => $button,
  261. 'mul' => true,
  262. 'list_button' => array
  263. (
  264. 'list' => array('查看详情', '"push_cash&project=bill&id={id}&page_type=1"'),
  265. 'fast' => array('审核', '"cash&where_id={id}&col=audit,audit_desc&oper_save_jump=cash&oper_table=cash&oper_parent=cash"', '{status} == 1'),
  266. //'fast1' => array('发放', '"tixian&where_id={id}&col=audit,audit_desc,pic&oper_save_jump=tixian&oper_table=tixian&oper_parent=tixian"', '{status} == 2'),
  267. ),
  268. ),
  269. 'request' => array
  270. (
  271. 'getData' => array
  272. (
  273. # 匹配的正则或函数 选填项
  274. 'option' => array
  275. (
  276. 'mid' => 'yes',
  277. 'type' => 'yes',
  278. 'state' => 1,
  279. ),
  280. 'order' => array('id' => 'desc'),
  281. 'page' => array(10, 'list'),
  282. 'type' => 'all',
  283. 'col' => '*',
  284. ),
  285. ),
  286. );