info_log.php 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  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. return array
  72. (
  73. # 表名
  74. 'name' => 'info_log',
  75. # 显示给用户看的名称
  76. 'lang' => '用户资金流水',
  77. 'menu' => false,
  78. 'info' => $desc,
  79. 'order' => 99,
  80. # 数据结构
  81. 'struct' => array
  82. (
  83. 'id' => array
  84. (
  85. 'type' => 'int-11',
  86. 'name' => 'ID',
  87. 'default' => '',
  88. 'desc' => '',
  89. 'match' => 'is_numeric',
  90. 'search' => 'order',
  91. //'list' => true,
  92. ),
  93. 'info_id' => array
  94. (
  95. 'type' => 'int-11',
  96. 'name' => '账户id',
  97. 'default' => '',
  98. 'desc' => '账户id',
  99. 'match' => 'is_numeric',
  100. ),
  101. 'uid' => array
  102. (
  103. 'type' => 'int-11',
  104. 'name' => $user,
  105. 'default' => '0',
  106. 'desc' => '用户名称',
  107. 'match' => 'is_numeric',
  108. 'search' => $search,
  109. 'value' => $uid,
  110. 'list_name' => '用户名称',
  111. 'list' => 'Dever::load("account/lib/info.getName", {uid}, {config_id})',
  112. //'list' => true,
  113. ),
  114. 'config_id' => array
  115. (
  116. 'type' => 'int-11',
  117. 'name' => '账户名称',
  118. 'default' => '1',
  119. 'desc' => '账户名称',
  120. 'match' => 'is_numeric',
  121. 'update' => 'select',
  122. 'option' => $config,
  123. 'search' => 'select',
  124. 'list' => true,
  125. ),
  126. 'project_id' => array
  127. (
  128. 'type' => 'int-11',
  129. 'name' => '所属项目',
  130. 'default' => '1',
  131. 'desc' => '所属项目',
  132. 'match' => 'is_numeric',
  133. 'update' => 'radio',
  134. 'option' => $project,
  135. 'list' => true,
  136. ),
  137. 'type_id' => array
  138. (
  139. 'type' => 'int-11',
  140. 'name' => '交易类型',
  141. 'default' => '1',
  142. 'desc' => '交易类型',
  143. 'match' => 'is_numeric',
  144. 'update' => 'radio',
  145. 'option' => $type,
  146. 'list' => true,
  147. ),
  148. 'source' => array
  149. (
  150. 'type' => 'varchar-150',
  151. 'name' => '来源表名',
  152. 'default' => '',
  153. 'desc' => '来源表名',
  154. 'match' => 'is_numeric',
  155. ),
  156. 'source_id' => array
  157. (
  158. 'type' => 'int-11',
  159. 'name' => '来源表id',
  160. 'default' => '',
  161. 'desc' => '来源表id',
  162. 'match' => 'is_string',
  163. 'update' => 'text',
  164. ),
  165. 'cash' => array
  166. (
  167. 'type' => 'decimal-11,2',
  168. 'name' => '金额',
  169. 'default' => '0',
  170. 'desc' => '金额',
  171. 'match' => 'is_numeric',
  172. 'update' => 'text',
  173. 'list_name' => '金额',
  174. 'list' => true,
  175. ),
  176. 'yue' => array
  177. (
  178. 'type' => 'decimal-11,2',
  179. 'name' => '操作后余额',
  180. 'default' => '0',
  181. 'desc' => '操作后余额',
  182. 'match' => 'is_numeric',
  183. 'update' => 'text',
  184. 'list' => true,
  185. ),
  186. 'desc' => array
  187. (
  188. 'type' => 'varchar-600',
  189. 'name' => '资金说明',
  190. 'default' => '',
  191. 'desc' => '资金说明',
  192. 'match' => 'is_string',
  193. 'update' => 'text',
  194. 'search' => 'fulltext',
  195. 'list' => true,
  196. ),
  197. 'admin_id' => array
  198. (
  199. 'type' => 'int-11',
  200. 'name' => '操作人',
  201. 'default' => '',
  202. 'desc' => '操作人',
  203. 'match' => 'is_string',
  204. 'update' => 'text',
  205. 'list' => '"{admin_id}" > 0 ? Dever::load("manage/admin-find#username", {admin_id}) : "-"',
  206. ),
  207. 'method' => array
  208. (
  209. 'type' => 'tinyint-1',
  210. 'name' => '方式',
  211. 'default' => '1',
  212. 'desc' => '方式',
  213. 'match' => 'is_numeric',
  214. 'update' => 'radio',
  215. 'option' => $method,
  216. ),
  217. 'state' => array
  218. (
  219. 'type' => 'tinyint-1',
  220. 'name' => '状态',
  221. 'default' => '1',
  222. 'desc' => '请选择状态',
  223. 'match' => 'is_numeric',
  224. ),
  225. 'cdate' => array
  226. (
  227. 'type' => 'int-11',
  228. 'name' => '交易时间',
  229. 'match' => array('is_numeric', time()),
  230. 'desc' => '',
  231. # 只有insert时才生效
  232. 'insert' => true,
  233. 'search' => 'date',
  234. 'list_name' => '交易时间',
  235. 'list' => 'date("Y-m-d H:i", {cdate})',
  236. ),
  237. ),
  238. 'manage' => array
  239. (
  240. 'insert' => false,
  241. 'delete' => false,
  242. 'edit' => false,
  243. 'button' => $button,
  244. ),
  245. 'request' => array
  246. (
  247. ),
  248. );