super_device.php 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <?php
  2. namespace app\admin;
  3. class super_device extends Base
  4. {
  5. public $statusText = [-2 => "签名失败", -1 => "解析失败", "未签名", "准备中", "正在解析", "正在签名", "正在打包", "签名完成"];
  6. public function initialize()
  7. {
  8. parent::initialize();
  9. $this->Administrator(6);
  10. $this->header();
  11. }
  12. public function __destruct()
  13. {
  14. ?> <script>
  15. $('input[name=sort]').on('input', function () {
  16. var sort = $(this).val();
  17. if (sort != $(this).attr('data-sort'))
  18. $.ajax({
  19. url: '?c=ajax&a=ios_device_sort',
  20. data: {id: $(this).attr('data-id'), sort: sort},
  21. type: 'post',
  22. success: function (ret) {
  23. console.log(ret)
  24. }
  25. });
  26. });
  27. </script>
  28. <?php
  29. $this->footer();
  30. }
  31. function index($map = [])
  32. {
  33. $this->search = SafeRequest("search", "get");
  34. $this->search && ($map[] = ["in_name|app_id|device_name|product|udid|cert_iss", "like", "%" . $this->search . "%"]);
  35. $_var_0 = SafeRequest("app_id", "get");
  36. if (is_numeric($_var_0)) {
  37. $map[] = ["app_id", "=", $_var_0];
  38. } else {
  39. $map[] = ["app_id", ">", "0"];
  40. }
  41. $this->cert_dec = SafeRequest("cert_dec", "get");
  42. is_numeric($this->cert_dec) && ($map[] = ["cert_dec", "=", $this->cert_dec]);
  43. $this->steal_time = SafeRequest("steal_time", "get");
  44. is_numeric($this->steal_time) && ($map[] = ["steal_time", $this->steal_time ? ">" : "=", "0"]);
  45. $_var_1 = SafeRequest("udid", "get");
  46. $_var_1 && ($map[] = ["udid", "=", $_var_1]);
  47. $_var_2 = SafeRequest("page", "get");
  48. $this->mapTime("create_time", true, $map);
  49. $_var_3 = db("ios_device")->alias("d")->join("appid a", "a.in_id=d.app_id", "left")->field("d.*,a.in_name app_name")->where($map)->order("create_time desc")->paginate(["page" => $_var_2]);
  50. $_var_4 = $_var_3->items();
  51. $_var_5 = getRender($_var_3, $_var_2);
  52. $_var_6 = $_var_3->total();
  53. ?><div class="container"><?php
  54. $this->nav3();
  55. $this->searchForm("", "", function () {
  56. ?> <select name="steal_time" onchange="document.btnsearch.submit();">
  57. <option value="">是否偷量</option>
  58. <option value="1" <?php echo $this->steal_time ? "selected=\"selected\"" : "";?>>是</option>
  59. <option value="0" <?php echo is_numeric($this->steal_time) && !$this->steal_time ? "selected=\"selected\"" : "";?>>
  60. </option>
  61. </select>
  62. <select name="cert_dec" onchange="document.btnsearch.submit();">
  63. <option value="">是否消耗证书</option>
  64. <option value="1" <?php echo $this->cert_dec ? "selected=\"selected\"" : "";?>>是</option>
  65. <option value="0" <?php echo is_numeric($this->cert_dec) && !$this->cert_dec ? "selected=\"selected\"" : "";?>>
  66. </option>
  67. </select>
  68. <?php
  69. });
  70. ?><table class="tb tb2">
  71. <tr><th class="partition">设备记录列表</th></tr>
  72. </table>
  73. <table class="layui-table">
  74. <thead>
  75. <tr>
  76. <th>ID</th>
  77. <th>app名称</th>
  78. <th>设备UDID</th>
  79. <th>设备名称</th>
  80. <th>设备型号</th>
  81. <th>设备版本</th>
  82. <th>所用证书</th>
  83. <th>偷量</th>
  84. <th>消耗证书</th>
  85. </tr>
  86. </thead>
  87. <?php
  88. if ($_var_6 == 0) {
  89. ?><tr><td colspan="22" style="margin:auto;text-align:center" >暂无数据</td></tr>
  90. <?php
  91. }
  92. if ($_var_4) {
  93. foreach ($_var_4 as $_var_7) {
  94. ?><tr class="hover">
  95. <td class="td25"><?php echo $_var_7["id"];?></td>
  96. <td><a href="?c=app&app_id=<?php echo $_var_7["app_id"];?>">[<?php echo $_var_7["app_id"];?>] - <?php echo $_var_7["app_name"] ?: "应用已删除";?></a></td>
  97. <td><a href="?c=ios_device&udid=<?php echo $_var_7["udid"];?>"><?php echo $_var_7["udid"];?></a></td>
  98. <td><?php echo $_var_7["device_name"] ?: "*";?></td>
  99. <td><?php echo $_var_7["product"] ?: "*";?></td>
  100. <td><?php echo $_var_7["version"] ?: "*";?></td>
  101. <td><a href="?c=super_cert&iss=<?php echo $_var_7["cert_iss"];?>"><?php echo $_var_7["cert_iss"];?></a></td>
  102. <td><?php echo $_var_7["steal_time"] ? "是" : "否";?></td>
  103. <td><?php echo $_var_7["cert_dec"] ? "是" : "否";?></td>
  104. </tr><?php
  105. }
  106. }
  107. ?></table></div><?php echo $_var_5;?><?php
  108. }
  109. }