query.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. {extend name="layout/content" /} {block name="header"}
  2. <title>账号角色查询</title>
  3. <link rel="stylesheet" href="__STATIC__/css/FuzzySearch.css?v={$Think.STATIC_VERSION}">
  4. <link href="//unpkg.com/layui@2.9.7/dist/css/layui.css" rel="stylesheet">
  5. <style>
  6. label {
  7. padding-top: 10px;
  8. margin-left: 10px;
  9. }
  10. .x-so {
  11. text-align: unset;
  12. margin-bottom: 20px;
  13. }
  14. section {
  15. margin-top: 10px;
  16. display: flex;
  17. }
  18. </style>
  19. {/block} {block name="content"}
  20. <div class="x-body">
  21. <form class="layui-form" method="get">
  22. <div class="layui-row layui-col-space10">
  23. <div class="layui-fluid">
  24. <label>商务:</label>
  25. <div class="layui-input-inline layui-form">
  26. <select name="business_type" lay-filter="business_type" id="business_type" lay-search>
  27. <option value="">请选择商务</option>
  28. </select>
  29. </div>
  30. <label>会长:</label>
  31. <div class="layui-input-inline">
  32. <select name="president_type" lay-filter="president_type" id="president_type" lay-search>
  33. <option value="">请选择会长</option>
  34. </select>
  35. </div>
  36. <label>子会长:</label>
  37. <div class="layui-input-inline">
  38. <select name="president_type_son" lay-filter="president_type_son" id="president_type_son" lay-search>
  39. <option value="">请选择子会长</option>
  40. </select>
  41. </div>
  42. <label>推广员:</label>
  43. <div class="layui-input-inline">
  44. <select name="promoter_type" lay-filter="promoter_type" id="promoter_type" lay-search>
  45. <option value="">请选择推广员</option>
  46. </select>
  47. </div>
  48. <div class="layui-inline">
  49. <label>开始时间:</label>
  50. <div class="layui-input-inline">
  51. <input class="layui-input" placeholder="开始日" value="{$Request.get.start_time}" name="start_time" id="start_time">
  52. </div>
  53. </div>
  54. <div class="layui-inline">
  55. <label>结束时间:</label>
  56. <div class="layui-input-inline">
  57. <input class="layui-input" placeholder="截止日" value="{$Request.get.end_time}" name="end_time" id="end_time">
  58. </div>
  59. </div>
  60. </div>
  61. <div class="layui-fluid">
  62. <div class="layui-inline">
  63. <label>游戏名:</label>
  64. <div class="layui-input-inline FuzzySearch_Container">
  65. <div>
  66. <input type="hidden" id='game_id' name="game_id" value="{$Request.get.game_id}"/>
  67. </div>
  68. </div>
  69. </div>
  70. <div class="layui-inline">
  71. <label>用户名:</label>
  72. <div class="layui-input-inline">
  73. <input class="layui-input" name="username" value="{$Request.get.username}" placeholder="请输入用户名">
  74. </div>
  75. </div>
  76. <div class="layui-inline">
  77. <label>角色名:</label>
  78. <div class="layui-input-inline">
  79. <input class="layui-input" name="rolename" value="{$Request.get.rolename}" placeholder="请输入角色名">
  80. </div>
  81. </div>
  82. <div class="layui-inline" style="margin-left: 10px;">
  83. <div class="layui-input-inline">
  84. <button class="layui-btn" lay-submit lay-filter="search" id="J_submit">查询</button>
  85. <a href="{$jh_url}" class="layui-btn" target="_blank">查看聚合数据</a>
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. <table class="layui-table">
  91. <thead>
  92. <tr>
  93. <th>ID</th>
  94. <th>用户ID</th>
  95. <th>注册账户</th>
  96. <th>游戏名</th>
  97. <th>角色ID</th>
  98. <th>角色名</th>
  99. <th>区服ID</th>
  100. <th>区服名称</th>
  101. <th>等级</th>
  102. <th>推广员账号</th>
  103. <th>子会长</th>
  104. <th>公会账号</th>
  105. <th>商务账号</th>
  106. <th>角色创建时间</th>
  107. <th>角色更新时间</th>
  108. </tr>
  109. </thead>
  110. <tbody id="viewer_wrap">
  111. {notempty name="list"} {volist name="list" id="vo"}
  112. <tr>
  113. <td>{$vo.id}</td>
  114. <td>{$vo.userid}</td>
  115. <td>{$vo.username}</td>
  116. <td>{$vo.game_name}</td>
  117. <td>{$vo.roleid}</td>
  118. <td>{$vo.rolename}</td>
  119. <td>{$vo.serverid}</td>
  120. <td>{$vo.servername}</td>
  121. <td>{$vo.rolelevel}</td>
  122. <td>{$vo.channel_three_name|default="-"}</td>
  123. <td>{$vo.channel_two_name|default="-"}</td>
  124. <td>{$vo.channel_one_name|default="-"}</td>
  125. <td>{$vo.channel_zero_name}</td>
  126. <td>{$vo.create_time? date('Y-m-d H:i:s',$vo.create_time) : '' }</td>
  127. <td>{$vo.update_time? date('Y-m-d H:i:s',$vo.update_time) : '' }</td>
  128. </tr>
  129. {/volist}
  130. {else/}
  131. <tr>
  132. <td colspan="5" style="text-align: center;">暂无数据</td>
  133. </tr>
  134. {/notempty}
  135. </tbody>
  136. </table>
  137. <div class="pager-container">
  138. <span>
  139. {:empty($list_count)?0:$list->total()}条记录
  140. </span>
  141. {$page}
  142. <div class="layui-inline" style="margin:0;margin-left:10px;width:80px;">
  143. <input type="text" style="height: 30px;" class="layui-input" placeholder="跳转至" name="page" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')">
  144. </div>
  145. </div>
  146. </form>
  147. </div>
  148. {/block} {block name="footer"}
  149. <script type="text/javascript" src="__STATIC__/js/FuzzySearch.js?v={$Think.STATIC_VERSION}"></script>
  150. <script>
  151. $("#game_id").FuzzySearch({
  152. inputID: 'game_id',
  153. title: '请输入游戏名称',
  154. data: {:json_encode($game_list)},
  155. searchBtn:'J_submit',
  156. });
  157. layui.use(['form', 'layer', 'laydate'], function () {
  158. var form = layui.form,
  159. layer = layui.layer,
  160. laydate = layui.laydate;
  161. var starttime = laydate.render({
  162. elem: '#start_time',
  163. type: 'date',
  164. format: 'yyyy-MM-dd',
  165. done: function (value, dates) {
  166. endtime.config.min = {
  167. year: dates.year,
  168. month: dates.month - 1, //关键
  169. date: dates.date,
  170. hours: 0,
  171. minutes: 0,
  172. seconds: 0
  173. };
  174. }
  175. });
  176. var endtime = laydate.render({
  177. elem: '#end_time',
  178. type: 'date',
  179. format: 'yyyy-MM-dd',
  180. done: function (value, dates) {
  181. starttime.config.max = {
  182. year: dates.year,
  183. month: dates.month - 1, //关键
  184. date: dates.date,
  185. hours: 0,
  186. minutes: 0,
  187. seconds: 0
  188. }
  189. }
  190. });
  191. // ## 推广四级下拉 ##
  192. var businessType = getQueryVariable("business_type"),
  193. president_type = getQueryVariable("president_type"),
  194. president_type_son = getQueryVariable("president_type_son"),
  195. promoter_type = getQueryVariable("promoter_type")
  196. // 初始化下拉
  197. getChannelSelectData('sw', '', businessType);
  198. getChannelSelectData('hz', businessType, president_type);
  199. getChannelSelectData('zhz', president_type, president_type_son);
  200. getChannelSelectData('tgy', president_type_son, promoter_type);
  201. /**
  202. * 获取下拉数据
  203. * @param type sw=商务/hz=会长/zhz=子会长/tgy=推广员
  204. * @param pid 上级ID
  205. * @param select_id 选中ID
  206. */
  207. function getChannelSelectData(type = 'sw', pid = '', select_id = ''){
  208. $.ajax({
  209. type: "GET",
  210. url: '{:url("Channel/getSelectList")}',
  211. dataType: "json",
  212. async: false,
  213. data: {'type': type,'pid': pid},
  214. success: function (res) {
  215. listData = res.data
  216. // console.log("## getChannelSelectData: ", listData)
  217. if (type === 'sw'){
  218. $("#business_type").empty();
  219. $("#business_type").append("<option value=''>请选择商务</option>")
  220. $.each(listData, function (i, item) {
  221. if (item.id == select_id){
  222. $("#business_type").append("<option value='" + item.id + "' selected>" + item.name + "</option>")
  223. }else{
  224. $("#business_type").append("<option value='" + item.id + "'>" + item.name + "</option>")
  225. }
  226. })
  227. }else if (type === 'hz'){
  228. $("#president_type").empty();
  229. $("#president_type").append("<option value=''>请选择会长</option>")
  230. $.each(listData, function (i, item) {
  231. if (item.id == select_id){
  232. $("#president_type").append("<option value='" + item.id + "' selected>" + item.name + "</option>")
  233. }else{
  234. $("#president_type").append("<option value='" + item.id + "'>" + item.name + "</option>")
  235. }
  236. })
  237. }else if (type === 'zhz'){
  238. $("#president_type_son").empty();
  239. $("#president_type_son").append("<option value=''>请选择子会长</option>")
  240. $.each(listData, function (i, item) {
  241. if (item.id == select_id){
  242. $("#president_type_son").append("<option value='" + item.id + "' selected>" + item.name + "</option>")
  243. }else{
  244. $("#president_type_son").append("<option value='" + item.id + "'>" + item.name + "</option>")
  245. }
  246. })
  247. }else if (type === 'tgy'){
  248. $("#promoter_type").empty();
  249. $("#promoter_type").append("<option value=''>请选择推广员</option>")
  250. $.each(listData, function (i, item) {
  251. if (item.id == select_id){
  252. $("#promoter_type").append("<option value='" + item.id + "' selected>" + item.name + "</option>")
  253. }else{
  254. $("#promoter_type").append("<option value='" + item.id + "'>" + item.name + "</option>")
  255. }
  256. })
  257. }
  258. form.render('select')
  259. },
  260. });
  261. }
  262. // 获取指定URL的参数值
  263. function getQueryVariable(name) {
  264. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  265. var r = window.location.search.substr(1).match(reg);
  266. if (r != null) return unescape(r[2]);
  267. return null;
  268. }
  269. form.on('select(business_type)', function (data) {
  270. if (data.value > 0){
  271. getChannelSelectData('hz', data.value, businessType);
  272. }else{
  273. getChannelSelectData('hz');
  274. getChannelSelectData('zhz');
  275. getChannelSelectData('tgy');
  276. }
  277. });
  278. form.on('select(president_type)', function (data) {
  279. if (data.value > 0){
  280. getChannelSelectData('zhz', data.value, president_type);
  281. }else{
  282. getChannelSelectData('zhz');
  283. }
  284. });
  285. form.on('select(president_type_son)', function (data) {
  286. if (data.value > 0){
  287. getChannelSelectData('tgy', data.value, promoter_type);
  288. }else{
  289. getChannelSelectData('tgy');
  290. }
  291. });
  292. form.on('submit(search)', function () {
  293. var gameId = $("#game_id").val(),
  294. username = $("input[name='username']").val(),
  295. rolename = $("input[name='rolename']").val();
  296. // if (!gameId) {
  297. // layer.msg('请选择游戏');
  298. // return false;
  299. // }
  300. /*
  301. if (username.length < 1 && rolename.length < 1) {
  302. layer.msg('请输入用户名或角色名');
  303. return false;
  304. }
  305. */
  306. })
  307. });
  308. </script>
  309. {/block}