info_log.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  1. <?php
  2. $project = function()
  3. {
  4. $array = array();
  5. $data = Dever::load('account/config_project-state');
  6. if($data)
  7. {
  8. $array += $data;
  9. }
  10. return $array;
  11. };
  12. $type = function()
  13. {
  14. $array = array();
  15. $data = Dever::load('account/config_type-state');
  16. if($data)
  17. {
  18. $array += $data;
  19. }
  20. return $array;
  21. };
  22. $config = function()
  23. {
  24. $array = array();
  25. $data = Dever::load('account/config-state');
  26. if($data)
  27. {
  28. $array += $data;
  29. }
  30. return $array;
  31. };
  32. $button = array();
  33. $desc = '';
  34. $user = '用户ID';
  35. $search = 'hidden';
  36. $config_key = Dever::input('config_key');
  37. if ($config_key) {
  38. $info = Dever::db('account/config')->find(array('key' => $config_key));
  39. if ($info) {
  40. Dever::setInput('set_config_id', $info['id']);
  41. }
  42. }
  43. $uid = Dever::input('search_option_uid');
  44. $config_id = Dever::input('set_config_id');
  45. if ($config_id && $uid) {
  46. $search_config = Dever::load('account/lib/manage')->getSearch($config_id);
  47. if ($search_config) {
  48. $search = $search_config;
  49. $user = '用户名称';
  50. $button['账户操作'] = array('fast', false, 'push');
  51. $button['设置提现人'] = array('fast', false, 'withdraw_info');
  52. $account_info = Dever::db('account/info')->find(array('config_id' => $config_id, 'uid' => $uid));
  53. if ($account_info) {
  54. $username = Dever::load("account/lib/project.getUsername", $uid, $config_id);
  55. $desc = '<blockquote class="layui-elem-quote">';
  56. $desc .= $search_config['project_name'] . '.' . $search_config['name'];
  57. $desc .= ' -> ';
  58. $desc .= '<b>' . $username.'</b>';
  59. $desc .= '<br />';
  60. $desc .= '可用金额:' . '<b>' . $account_info['cash'] . '</b>';
  61. $desc .= ' 总增加金额:' . '<b>' . $account_info['z_cash'] . '</b>';
  62. $desc .= ' 总减少金额:' . '<b>' . $account_info['t_cash'] . '</b>';
  63. $desc .= '</blockquote>';
  64. }
  65. }
  66. }
  67. $method = array
  68. (
  69. 1 => '自动',
  70. 2 => '手动',
  71. );
  72. $status = array
  73. (
  74. 1 => '待审核',
  75. 2 => '已审核',
  76. 3 => '已发放',
  77. 4 => '已作废',
  78. );
  79. $col = Dever::input('col');
  80. $fafang = Dever::input('fafang');
  81. if ($fafang == 1) {
  82. $audit_status = array
  83. (
  84. //1 => '待审核',
  85. //2 => '已审核',
  86. 3 => '已发放',
  87. 4 => '已作废',
  88. );
  89. } else {
  90. $audit_status = array
  91. (
  92. //1 => '待审核',
  93. 2 => '已审核',
  94. //3 => '已发放',
  95. 4 => '已作废',
  96. );
  97. }
  98. return array
  99. (
  100. # 表名
  101. 'name' => 'info_log',
  102. # 显示给用户看的名称
  103. 'lang' => '用户资金流水',
  104. 'menu' => false,
  105. 'info' => $desc,
  106. 'order' => 99,
  107. 'end' => array
  108. (
  109. 'update' => 'account/lib/manage.audit',
  110. 'updatemul' => 'account/lib/manage.audit',
  111. ),
  112. # 数据结构
  113. 'struct' => array
  114. (
  115. 'id' => array
  116. (
  117. 'type' => 'int-11',
  118. 'name' => 'ID',
  119. 'default' => '',
  120. 'desc' => '',
  121. 'match' => 'is_numeric',
  122. 'search' => 'order',
  123. //'list' => true,
  124. ),
  125. 'order_num' => array
  126. (
  127. 'type' => 'varchar-100',
  128. 'name' => '流水号',
  129. 'default' => '',
  130. 'desc' => '流水号',
  131. 'match' => 'is_string',
  132. 'search' => 'fulltext',
  133. 'list' => true,
  134. ),
  135. 'info_id' => array
  136. (
  137. 'type' => 'int-11',
  138. 'name' => '账户id',
  139. 'default' => '',
  140. 'desc' => '账户id',
  141. 'match' => 'is_numeric',
  142. 'search' => 'hidden',
  143. ),
  144. 'uid' => array
  145. (
  146. 'type' => 'int-11',
  147. 'name' => $user,
  148. 'default' => '0',
  149. 'desc' => '用户名称',
  150. 'match' => 'is_numeric',
  151. 'search' => 'hidden',
  152. 'value' => $uid,
  153. 'list_name' => '用户名称',
  154. 'list' => 'Dever::load("account/lib/project.getUsername", {uid}, {config_id})',
  155. //'list' => true,
  156. ),
  157. 'config_id' => array
  158. (
  159. 'type' => 'int-11',
  160. 'name' => '账户名称',
  161. 'default' => '1',
  162. 'desc' => '账户名称',
  163. 'match' => 'is_numeric',
  164. 'update' => 'select',
  165. 'option' => $config,
  166. //'search' => 'select',
  167. //'list' => true,
  168. ),
  169. 'project_id' => array
  170. (
  171. 'type' => 'int-11',
  172. 'name' => '所属项目',
  173. 'default' => '1',
  174. 'desc' => '所属项目',
  175. 'match' => 'is_numeric',
  176. 'update' => 'radio',
  177. 'option' => $project,
  178. 'list' => true,
  179. ),
  180. 'type_id' => array
  181. (
  182. 'type' => 'int-11',
  183. 'name' => '交易类型',
  184. 'default' => '1',
  185. 'desc' => '交易类型',
  186. 'match' => 'is_numeric',
  187. 'search' => 'select',
  188. 'update' => 'radio',
  189. 'option' => $type,
  190. 'list' => true,
  191. ),
  192. 'source' => array
  193. (
  194. 'type' => 'varchar-150',
  195. 'name' => '来源表名',
  196. 'default' => '',
  197. 'desc' => '来源表名',
  198. 'match' => 'is_numeric',
  199. ),
  200. 'source_id' => array
  201. (
  202. 'type' => 'int-11',
  203. 'name' => '来源表id',
  204. 'default' => '',
  205. 'desc' => '来源表id',
  206. 'match' => 'is_string',
  207. 'update' => 'text',
  208. ),
  209. 'ycash' => 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. ),
  219. 'cash' => array
  220. (
  221. 'type' => 'decimal-11,2',
  222. 'name' => '实际金额',
  223. 'default' => '0',
  224. 'desc' => '实际金额',
  225. 'match' => 'is_numeric',
  226. 'update' => 'text',
  227. 'list' => true,
  228. ),
  229. 'yue' => array
  230. (
  231. 'type' => 'decimal-11,2',
  232. 'name' => '操作后余额',
  233. 'default' => '0',
  234. 'desc' => '操作后余额',
  235. 'match' => 'is_numeric',
  236. 'update' => 'text',
  237. 'list' => true,
  238. ),
  239. 'desc' => array
  240. (
  241. 'type' => 'varchar-600',
  242. 'name' => '资金说明',
  243. 'default' => '',
  244. 'desc' => '资金说明',
  245. 'match' => 'is_string',
  246. 'update' => 'text',
  247. 'search' => 'fulltext',
  248. 'list' => true,
  249. ),
  250. 'method' => array
  251. (
  252. 'type' => 'tinyint-1',
  253. 'name' => '方式',
  254. 'default' => '1',
  255. 'desc' => '方式',
  256. 'match' => 'is_numeric',
  257. 'update' => 'radio',
  258. 'option' => $method,
  259. ),
  260. 'status' => array
  261. (
  262. 'type' => 'tinyint-1',
  263. 'name' => '状态',
  264. 'default' => '2',
  265. 'desc' => '状态',
  266. 'match' => 'is_numeric',
  267. 'option' => $status,
  268. 'list' => 'Dever::load("account/lib/log.status", {type_id}, {status})',
  269. ),
  270. 'audit_admin' => array
  271. (
  272. 'type' => 'int-11',
  273. 'name' => '审核人',
  274. 'default' => '',
  275. 'match' => 'is_numeric',
  276. 'desc' => '审核人',
  277. //'list' => '"{audit_admin}" > 0 ? Dever::load("user/lib/info.get#name", {audit_admin}) : "-"',
  278. 'list' => 'user/lib/info.get#name',
  279. ),
  280. 'audit_status' => array
  281. (
  282. 'type' => 'tinyint-1',
  283. 'name' => '审核状态',
  284. 'default' => '2',
  285. 'desc' => '审核状态',
  286. 'match' => 'is_numeric',
  287. 'option' => $audit_status,
  288. 'update' => $col ? 'radio' : false,
  289. 'control' => 'audit_status',
  290. ),
  291. 'audit_desc' => array
  292. (
  293. 'type' => 'varchar-500',
  294. 'name' => '审核备注',
  295. 'default' => '',
  296. 'desc' => '审核备注',
  297. 'match' => 'is_string',
  298. 'update' => $col ? 'textarea' : false,
  299. 'show' => 'audit_status=4',
  300. 'list' => '"{audit_desc}" ? "{audit_desc}" : "-"',
  301. ),
  302. 'audit_date' => array
  303. (
  304. 'type' => 'int-11',
  305. 'name' => '审核时间',
  306. 'match' => 'is_numeric',
  307. 'desc' => '审核时间',
  308. 'default' => '',
  309. 'list' => 'time',
  310. ),
  311. 'state' => array
  312. (
  313. 'type' => 'tinyint-1',
  314. 'name' => '状态',
  315. 'default' => '1',
  316. 'desc' => '请选择状态',
  317. 'match' => 'is_numeric',
  318. ),
  319. 'cdate' => array
  320. (
  321. 'type' => 'int-11',
  322. 'name' => '交易时间',
  323. 'match' => array('is_numeric', time()),
  324. 'desc' => '',
  325. # 只有insert时才生效
  326. 'insert' => true,
  327. 'search' => 'date',
  328. 'list_name' => '交易时间',
  329. 'list' => 'time',
  330. ),
  331. ),
  332. 'manage' => array
  333. (
  334. 'insert' => false,
  335. 'delete' => false,
  336. 'edit' => false,
  337. 'button' => $button,
  338. 'excel' => true,
  339. # 列表
  340. 'list_button' => array
  341. (
  342. 'edit' => array('审核', 'audit_status,audit_desc', '{status} == 1'),
  343. 'edit' => array('发放', 'audit_status,audit_desc,fafang', '{status} == 2 && {type_id} == 2'),
  344. ),
  345. ),
  346. 'request' => array
  347. (
  348. 'getData' => array
  349. (
  350. 'type' => 'all',
  351. 'option' => array
  352. (
  353. 'config_id' => 'yes',
  354. 'info_id' => 'yes',
  355. 'start' => array('yes-cdate', '>='),
  356. 'end' => array('yes-cdate', '<='),
  357. 'state' => 1,
  358. ),
  359. 'page' => array(10, 'list'),
  360. 'col' => '*',
  361. ),
  362. ),
  363. );