info_log.php 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  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('search_option_config_id', $info['id']);
  41. }
  42. }
  43. $uid = Dever::input('search_option_uid');
  44. $config_id = Dever::input('search_option_config_id');
  45. if ($config_id && $uid) {
  46. $search_config = Dever::load('account/lib/info')->getSearch($config_id);
  47. if ($search_config) {
  48. $search = $search_config;
  49. $user = '用户名称';
  50. $button['账户操作'] = array('fast', false, 'push');
  51. $account_info = Dever::db('account/info')->find(array('config_id' => $config_id, 'uid' => $uid));
  52. if ($account_info) {
  53. $username = Dever::load("account/lib/info.getName", $uid, $config_id);
  54. $desc = '<blockquote class="layui-elem-quote">';
  55. $desc .= $search_config['project_name'] . '.' . $search_config['name'];
  56. $desc .= ' -> ';
  57. $desc .= '<b>' . $username.'</b>';
  58. $desc .= '<br />';
  59. $desc .= '可用金额:' . '<b>' . $account_info['cash'] . '</b>';
  60. $desc .= ' 总增加金额:' . '<b>' . $account_info['z_cash'] . '</b>';
  61. $desc .= ' 总减少金额:' . '<b>' . $account_info['t_cash'] . '</b>';
  62. $desc .= '</blockquote>';
  63. }
  64. }
  65. }
  66. $method = array
  67. (
  68. 1 => '自动',
  69. 2 => '手动',
  70. );
  71. $status = array
  72. (
  73. 1 => '待审核',
  74. 2 => '已审核',
  75. 3 => '已发放',
  76. 4 => '已作废',
  77. );
  78. $audit_status = array
  79. (
  80. //1 => '待审核',
  81. 2 => '已审核',
  82. //3 => '已发放',
  83. 4 => '已作废',
  84. );
  85. $col = Dever::input('col');
  86. return array
  87. (
  88. # 表名
  89. 'name' => 'info_log',
  90. # 显示给用户看的名称
  91. 'lang' => '用户资金流水',
  92. 'menu' => false,
  93. 'info' => $desc,
  94. 'order' => 99,
  95. # 数据结构
  96. 'struct' => array
  97. (
  98. 'id' => array
  99. (
  100. 'type' => 'int-11',
  101. 'name' => 'ID',
  102. 'default' => '',
  103. 'desc' => '',
  104. 'match' => 'is_numeric',
  105. 'search' => 'order',
  106. //'list' => true,
  107. ),
  108. 'info_id' => array
  109. (
  110. 'type' => 'int-11',
  111. 'name' => '账户id',
  112. 'default' => '',
  113. 'desc' => '账户id',
  114. 'match' => 'is_numeric',
  115. ),
  116. 'uid' => array
  117. (
  118. 'type' => 'int-11',
  119. 'name' => $user,
  120. 'default' => '0',
  121. 'desc' => '用户名称',
  122. 'match' => 'is_numeric',
  123. 'search' => $search,
  124. 'value' => $uid,
  125. 'list_name' => '用户名称',
  126. 'list' => 'Dever::load("account/lib/info.getName", {uid}, {config_id})',
  127. //'list' => true,
  128. ),
  129. 'config_id' => array
  130. (
  131. 'type' => 'int-11',
  132. 'name' => '账户名称',
  133. 'default' => '1',
  134. 'desc' => '账户名称',
  135. 'match' => 'is_numeric',
  136. 'update' => 'select',
  137. 'option' => $config,
  138. 'search' => 'select',
  139. 'list' => true,
  140. ),
  141. 'project_id' => array
  142. (
  143. 'type' => 'int-11',
  144. 'name' => '所属项目',
  145. 'default' => '1',
  146. 'desc' => '所属项目',
  147. 'match' => 'is_numeric',
  148. 'update' => 'radio',
  149. 'option' => $project,
  150. 'list' => true,
  151. ),
  152. 'type_id' => array
  153. (
  154. 'type' => 'int-11',
  155. 'name' => '交易类型',
  156. 'default' => '1',
  157. 'desc' => '交易类型',
  158. 'match' => 'is_numeric',
  159. 'update' => 'radio',
  160. 'option' => $type,
  161. 'list' => true,
  162. ),
  163. 'source' => array
  164. (
  165. 'type' => 'varchar-150',
  166. 'name' => '来源表名',
  167. 'default' => '',
  168. 'desc' => '来源表名',
  169. 'match' => 'is_numeric',
  170. ),
  171. 'source_id' => array
  172. (
  173. 'type' => 'int-11',
  174. 'name' => '来源表id',
  175. 'default' => '',
  176. 'desc' => '来源表id',
  177. 'match' => 'is_string',
  178. 'update' => 'text',
  179. ),
  180. 'ycash' => array
  181. (
  182. 'type' => 'decimal-11,2',
  183. 'name' => '金额',
  184. 'default' => '0',
  185. 'desc' => '金额',
  186. 'match' => 'is_numeric',
  187. 'update' => 'text',
  188. 'list' => true,
  189. ),
  190. 'cash' => array
  191. (
  192. 'type' => 'decimal-11,2',
  193. 'name' => '实际金额',
  194. 'default' => '0',
  195. 'desc' => '实际金额',
  196. 'match' => 'is_numeric',
  197. 'update' => 'text',
  198. 'list' => true,
  199. ),
  200. 'yue' => array
  201. (
  202. 'type' => 'decimal-11,2',
  203. 'name' => '操作后余额',
  204. 'default' => '0',
  205. 'desc' => '操作后余额',
  206. 'match' => 'is_numeric',
  207. 'update' => 'text',
  208. 'list' => true,
  209. ),
  210. 'desc' => array
  211. (
  212. 'type' => 'varchar-600',
  213. 'name' => '资金说明',
  214. 'default' => '',
  215. 'desc' => '资金说明',
  216. 'match' => 'is_string',
  217. 'update' => 'text',
  218. 'search' => 'fulltext',
  219. 'list' => true,
  220. ),
  221. 'method' => array
  222. (
  223. 'type' => 'tinyint-1',
  224. 'name' => '方式',
  225. 'default' => '1',
  226. 'desc' => '方式',
  227. 'match' => 'is_numeric',
  228. 'update' => 'radio',
  229. 'option' => $method,
  230. ),
  231. 'status' => array
  232. (
  233. 'type' => 'tinyint-1',
  234. 'name' => '状态',
  235. 'default' => '2',
  236. 'desc' => '状态',
  237. 'match' => 'is_numeric',
  238. 'option' => $status,
  239. 'list' => true,
  240. ),
  241. 'audit_admin' => array
  242. (
  243. 'type' => 'int-11',
  244. 'name' => '审核人',
  245. 'default' => '',
  246. 'match' => 'is_numeric',
  247. 'desc' => '审核人',
  248. 'list' => '"{audit_admin}" > 0 ? Dever::load("manage/admin-find#username", {audit_admin}) : "-"',
  249. ),
  250. 'audit_status' => array
  251. (
  252. 'type' => 'tinyint-1',
  253. 'name' => '审核状态',
  254. 'default' => '2',
  255. 'desc' => '审核状态',
  256. 'match' => 'is_numeric',
  257. 'option' => $audit_status,
  258. 'update' => $col ? 'radio' : false,
  259. 'control' => 'audit_status',
  260. ),
  261. 'audit_desc' => array
  262. (
  263. 'type' => 'varchar-500',
  264. 'name' => '审核备注',
  265. 'default' => '',
  266. 'desc' => '审核备注',
  267. 'match' => 'is_string',
  268. 'update' => $col ? 'textarea' : false,
  269. 'show' => 'audit_status=4',
  270. 'list' => '"{audit_desc}" ? "{audit_desc}" : "-"',
  271. ),
  272. 'audit_date' => array
  273. (
  274. 'type' => 'int-11',
  275. 'name' => '审核时间',
  276. 'match' => 'is_numeric',
  277. 'desc' => '审核时间',
  278. 'default' => '',
  279. 'list' => '{audit_date} ? date("Y-m-d H:i:s", {audit_date}) : "-"',
  280. ),
  281. 'state' => array
  282. (
  283. 'type' => 'tinyint-1',
  284. 'name' => '状态',
  285. 'default' => '1',
  286. 'desc' => '请选择状态',
  287. 'match' => 'is_numeric',
  288. ),
  289. 'cdate' => array
  290. (
  291. 'type' => 'int-11',
  292. 'name' => '交易时间',
  293. 'match' => array('is_numeric', time()),
  294. 'desc' => '',
  295. # 只有insert时才生效
  296. 'insert' => true,
  297. 'search' => 'date',
  298. 'list_name' => '交易时间',
  299. 'list' => 'date("Y-m-d H:i", {cdate})',
  300. ),
  301. ),
  302. 'manage' => array
  303. (
  304. 'insert' => false,
  305. 'delete' => false,
  306. 'edit' => false,
  307. 'button' => $button,
  308. # 列表
  309. 'list_button' => array
  310. (
  311. 'edit' => array('审核', 'audit_status,audit_desc', '{status} == 1'),
  312. ),
  313. ),
  314. 'request' => array
  315. (
  316. ),
  317. );