info_log.php 11 KB

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