cash.php 12 KB

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