cash.php 11 KB

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