cash.php 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  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. 'search' => 'fulltext',
  99. 'list_order' => 3,
  100. ),
  101. 'agent-member-role'=> array
  102. (
  103. 'name' => '代理角色',
  104. 'default' => '',
  105. 'desc' => '代理角色',
  106. 'match' => 'option',
  107. # 读取另外表的关联方式
  108. 'sync' => array('mid', 'id'),
  109. 'list' => 'Dever::load("setting/role-find#name", "{agent-member-role}")',
  110. 'list_order' => 5,
  111. ),
  112. 'order_num' => array
  113. (
  114. 'type' => 'varchar-100',
  115. 'name' => '流水号',
  116. 'default' => '',
  117. 'desc' => '流水号',
  118. 'match' => 'is_string',
  119. 'update' => 'text',
  120. 'search' => 'fulltext',
  121. 'list' => true,
  122. 'list_order' => 1,
  123. ),
  124. 'role' => array
  125. (
  126. 'type' => 'int-11',
  127. 'name' => '代理角色',
  128. 'default' => '',
  129. 'desc' => '代理角色',
  130. 'match' => 'is_numeric',
  131. //'search' => 'select',
  132. 'update' => 'checkbox',
  133. 'option' => $role,
  134. //'list' => true,
  135. ),
  136. 'type' => array
  137. (
  138. 'type' => 'int-11',
  139. 'name' => '交易类型',
  140. 'default' => '1',
  141. 'desc' => '交易类型',
  142. 'match' => 'is_numeric',
  143. 'search' => 'select',
  144. 'update' => 'checkbox',
  145. 'option' => $type,
  146. 'list' => true,
  147. 'list_order' => 7,
  148. ),
  149. 'type_id' => array
  150. (
  151. 'type' => 'int-11',
  152. 'name' => '交易来源id',
  153. 'default' => '',
  154. 'desc' => '交易来源id',
  155. 'match' => 'is_string',
  156. 'update' => 'text',
  157. ),
  158. 'cash' => array
  159. (
  160. 'type' => 'float-11,2',
  161. 'name' => '金额',
  162. 'default' => '0',
  163. 'desc' => '金额',
  164. 'match' => 'is_numeric',
  165. 'update' => 'text',
  166. 'list' => true,
  167. 'list_order' => 6,
  168. ),
  169. 'yue' => array
  170. (
  171. 'type' => 'float-11,2',
  172. 'name' => '操作后余额',
  173. 'default' => '0',
  174. 'desc' => '操作后余额',
  175. 'match' => 'is_numeric',
  176. 'update' => 'text',
  177. 'list' => true,
  178. 'list_order' => 7,
  179. ),
  180. 'status' => array
  181. (
  182. 'type' => 'int-11',
  183. 'name' => '交易状态',
  184. 'default' => '1',
  185. 'desc' => '交易状态',
  186. 'match' => 'is_numeric',
  187. 'update' => 'hidden',
  188. 'option' => $status,
  189. 'search' => 'select',
  190. 'list' => true,
  191. 'list_name' => '交易状态',
  192. 'list_order' => 8,
  193. ),
  194. 'audit' => array
  195. (
  196. 'type' => 'int-11',
  197. 'name' => '审核状态',
  198. 'default' => '2',
  199. 'desc' => '审核状态',
  200. 'match' => 'is_numeric',
  201. 'update' => 'radio',
  202. 'option' => $manage_status,
  203. 'mul' => true,
  204. 'control' => 'audit',
  205. ),
  206. 'audit_desc' => array
  207. (
  208. 'type' => 'varchar-600',
  209. 'name' => '备注',
  210. 'default' => '',
  211. 'desc' => '审核说明',
  212. 'match' => 'is_string',
  213. 'update' => 'textarea',
  214. 'list' => '"{audit_desc}" ? "{audit_desc}" : "-"',
  215. 'list_order' => 9,
  216. 'show' => 'audit=3',
  217. ),
  218. 'desc' => array
  219. (
  220. 'type' => 'varchar-600',
  221. 'name' => '资金说明',
  222. 'default' => '',
  223. 'desc' => '资金说明',
  224. 'match' => 'is_string',
  225. 'update' => 'text',
  226. ),
  227. 'operdate' => array
  228. (
  229. 'type' => 'int-11',
  230. 'name' => '审核确认时间',
  231. 'default' => '',
  232. 'match' => 'is_numeric',
  233. 'desc' => '',
  234. 'list' => '"{operdate}" > 0 ? date("Y-m-d H:i", {operdate}) : "-"',
  235. 'list_order' => 9,
  236. ),
  237. 'state' => array
  238. (
  239. 'type' => 'tinyint-1',
  240. 'name' => '状态',
  241. 'default' => '1',
  242. 'desc' => '请选择状态',
  243. 'match' => 'is_numeric',
  244. ),
  245. 'cdate' => array
  246. (
  247. 'type' => 'int-11',
  248. 'name' => '交易时间',
  249. 'match' => array('is_numeric', time()),
  250. 'desc' => '',
  251. # 只有insert时才生效
  252. //'insert' => true,
  253. 'search' => 'date',
  254. 'list' => 'date("Y-m-d H:i", {cdate})',
  255. 'list_order' => 2,
  256. ),
  257. ),
  258. 'manage' => array
  259. (
  260. 'insert' => false,
  261. 'delete' => false,
  262. 'edit' => false,
  263. 'button' => $button,
  264. 'mul' => true,
  265. 'list_button' => array
  266. (
  267. 'list' => array('查看详情', '"push_cash&project=bill&id={id}&page_type=1"'),
  268. 'fast' => array('审核', '"cash&where_id={id}&col=audit,audit_desc&oper_save_jump=cash&oper_table=cash&oper_parent=cash"', '{status} == 1'),
  269. //'fast1' => array('发放', '"tixian&where_id={id}&col=audit,audit_desc,pic&oper_save_jump=tixian&oper_table=tixian&oper_parent=tixian"', '{status} == 2'),
  270. ),
  271. ),
  272. 'request' => array
  273. (
  274. 'getData' => array
  275. (
  276. # 匹配的正则或函数 选填项
  277. 'option' => array
  278. (
  279. 'mid' => 'yes',
  280. 'type' => 'yes',
  281. 'state' => 1,
  282. ),
  283. 'order' => array('id' => 'desc'),
  284. 'page' => array(10, 'list'),
  285. 'type' => 'all',
  286. 'col' => '*',
  287. ),
  288. # 获取订单数量
  289. 'getCash' => array
  290. (
  291. # 匹配的正则或函数 选填项
  292. 'option' => array
  293. (
  294. 'start' => array('yes-cdate', '>='),
  295. 'end' => array('yes-cdate', '<='),
  296. 'type' => array('yes', 'in'),
  297. 'status' => 2,
  298. 'state' => 1,
  299. ),
  300. 'type' => 'one',
  301. 'col' => 'sum(cash) as total',
  302. ),
  303. ),
  304. );