info_log.php 11 KB

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