info_log.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  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. $audit_status = array
  80. (
  81. //1 => '待审核',
  82. 2 => '已审核',
  83. //3 => '已发放',
  84. 4 => '已作废',
  85. );
  86. $col = Dever::input('col');
  87. return array
  88. (
  89. # 表名
  90. 'name' => 'info_log',
  91. # 显示给用户看的名称
  92. 'lang' => '用户资金流水',
  93. 'menu' => false,
  94. 'info' => $desc,
  95. 'order' => 99,
  96. 'end' => array
  97. (
  98. 'update' => 'account/lib/manage.audit',
  99. 'updatemul' => 'account/lib/manage.audit',
  100. ),
  101. # 数据结构
  102. 'struct' => array
  103. (
  104. 'id' => array
  105. (
  106. 'type' => 'int-11',
  107. 'name' => 'ID',
  108. 'default' => '',
  109. 'desc' => '',
  110. 'match' => 'is_numeric',
  111. 'search' => 'order',
  112. //'list' => true,
  113. ),
  114. 'order_num' => array
  115. (
  116. 'type' => 'varchar-100',
  117. 'name' => '流水号',
  118. 'default' => '',
  119. 'desc' => '流水号',
  120. 'match' => 'is_string',
  121. 'search' => 'fulltext',
  122. 'list' => true,
  123. ),
  124. 'info_id' => array
  125. (
  126. 'type' => 'int-11',
  127. 'name' => '账户id',
  128. 'default' => '',
  129. 'desc' => '账户id',
  130. 'match' => 'is_numeric',
  131. 'search' => 'hidden',
  132. ),
  133. 'uid' => array
  134. (
  135. 'type' => 'int-11',
  136. 'name' => $user,
  137. 'default' => '0',
  138. 'desc' => '用户名称',
  139. 'match' => 'is_numeric',
  140. 'search' => 'hidden',
  141. 'value' => $uid,
  142. 'list_name' => '用户名称',
  143. 'list' => 'Dever::load("account/lib/project.getUsername", {uid}, {config_id})',
  144. //'list' => true,
  145. ),
  146. 'config_id' => array
  147. (
  148. 'type' => 'int-11',
  149. 'name' => '账户名称',
  150. 'default' => '1',
  151. 'desc' => '账户名称',
  152. 'match' => 'is_numeric',
  153. 'update' => 'select',
  154. 'option' => $config,
  155. //'search' => 'select',
  156. //'list' => true,
  157. ),
  158. 'project_id' => array
  159. (
  160. 'type' => 'int-11',
  161. 'name' => '所属项目',
  162. 'default' => '1',
  163. 'desc' => '所属项目',
  164. 'match' => 'is_numeric',
  165. 'update' => 'radio',
  166. 'option' => $project,
  167. 'list' => true,
  168. ),
  169. 'type_id' => array
  170. (
  171. 'type' => 'int-11',
  172. 'name' => '交易类型',
  173. 'default' => '1',
  174. 'desc' => '交易类型',
  175. 'match' => 'is_numeric',
  176. 'search' => 'select',
  177. 'update' => 'radio',
  178. 'option' => $type,
  179. 'list' => true,
  180. ),
  181. 'source' => array
  182. (
  183. 'type' => 'varchar-150',
  184. 'name' => '来源表名',
  185. 'default' => '',
  186. 'desc' => '来源表名',
  187. 'match' => 'is_numeric',
  188. ),
  189. 'source_id' => array
  190. (
  191. 'type' => 'int-11',
  192. 'name' => '来源表id',
  193. 'default' => '',
  194. 'desc' => '来源表id',
  195. 'match' => 'is_string',
  196. 'update' => 'text',
  197. ),
  198. 'ycash' => array
  199. (
  200. 'type' => 'decimal-11,2',
  201. 'name' => '金额',
  202. 'default' => '0',
  203. 'desc' => '金额',
  204. 'match' => 'is_numeric',
  205. 'update' => 'text',
  206. 'list' => true,
  207. ),
  208. 'cash' => 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. ),
  218. 'yue' => array
  219. (
  220. 'type' => 'decimal-11,2',
  221. 'name' => '操作后余额',
  222. 'default' => '0',
  223. 'desc' => '操作后余额',
  224. 'match' => 'is_numeric',
  225. 'update' => 'text',
  226. 'list' => true,
  227. ),
  228. 'desc' => array
  229. (
  230. 'type' => 'varchar-600',
  231. 'name' => '资金说明',
  232. 'default' => '',
  233. 'desc' => '资金说明',
  234. 'match' => 'is_string',
  235. 'update' => 'text',
  236. 'search' => 'fulltext',
  237. 'list' => true,
  238. ),
  239. 'method' => array
  240. (
  241. 'type' => 'tinyint-1',
  242. 'name' => '方式',
  243. 'default' => '1',
  244. 'desc' => '方式',
  245. 'match' => 'is_numeric',
  246. 'update' => 'radio',
  247. 'option' => $method,
  248. ),
  249. 'status' => array
  250. (
  251. 'type' => 'tinyint-1',
  252. 'name' => '状态',
  253. 'default' => '2',
  254. 'desc' => '状态',
  255. 'match' => 'is_numeric',
  256. 'option' => $status,
  257. 'list' => 'Dever::load("account/lib/log.status", {type_id}, {status})',
  258. ),
  259. 'audit_admin' => array
  260. (
  261. 'type' => 'int-11',
  262. 'name' => '审核人',
  263. 'default' => '',
  264. 'match' => 'is_numeric',
  265. 'desc' => '审核人',
  266. //'list' => '"{audit_admin}" > 0 ? Dever::load("user/lib/info.get#name", {audit_admin}) : "-"',
  267. 'list' => 'user/lib/info.get#name',
  268. ),
  269. 'audit_status' => array
  270. (
  271. 'type' => 'tinyint-1',
  272. 'name' => '审核状态',
  273. 'default' => '2',
  274. 'desc' => '审核状态',
  275. 'match' => 'is_numeric',
  276. 'option' => $audit_status,
  277. 'update' => $col ? 'radio' : false,
  278. 'control' => 'audit_status',
  279. ),
  280. 'audit_desc' => array
  281. (
  282. 'type' => 'varchar-500',
  283. 'name' => '审核备注',
  284. 'default' => '',
  285. 'desc' => '审核备注',
  286. 'match' => 'is_string',
  287. 'update' => $col ? 'textarea' : false,
  288. 'show' => 'audit_status=4',
  289. 'list' => '"{audit_desc}" ? "{audit_desc}" : "-"',
  290. ),
  291. 'audit_date' => array
  292. (
  293. 'type' => 'int-11',
  294. 'name' => '审核时间',
  295. 'match' => 'is_numeric',
  296. 'desc' => '审核时间',
  297. 'default' => '',
  298. 'list' => 'time',
  299. ),
  300. 'state' => array
  301. (
  302. 'type' => 'tinyint-1',
  303. 'name' => '状态',
  304. 'default' => '1',
  305. 'desc' => '请选择状态',
  306. 'match' => 'is_numeric',
  307. ),
  308. 'cdate' => array
  309. (
  310. 'type' => 'int-11',
  311. 'name' => '交易时间',
  312. 'match' => array('is_numeric', time()),
  313. 'desc' => '',
  314. # 只有insert时才生效
  315. 'insert' => true,
  316. 'search' => 'date',
  317. 'list_name' => '交易时间',
  318. 'list' => 'time',
  319. ),
  320. ),
  321. 'manage' => array
  322. (
  323. 'insert' => false,
  324. 'delete' => false,
  325. 'edit' => false,
  326. 'button' => $button,
  327. 'excel' => true,
  328. # 列表
  329. 'list_button' => array
  330. (
  331. 'edit' => array('审核', 'audit_status,audit_desc', '{status} == 1'),
  332. 'edit' => array('发放', 'audit_status,audit_desc', '{status} == 2 && {type_id} == 2'),
  333. ),
  334. ),
  335. 'request' => array
  336. (
  337. 'getData' => array
  338. (
  339. 'type' => 'all',
  340. 'option' => array
  341. (
  342. 'config_id' => 'yes',
  343. 'info_id' => 'yes',
  344. 'start' => array('yes-cdate', '>='),
  345. 'end' => array('yes-cdate', '<='),
  346. 'state' => 1,
  347. ),
  348. 'page' => array(10, 'list'),
  349. 'col' => '*',
  350. ),
  351. ),
  352. );