cash.php 13 KB

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