user_aclog.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. namespace app\admin;
  3. class user_aclog extends Base
  4. {
  5. public function initialize()
  6. {
  7. parent::initialize();
  8. $this->Administrator(6);
  9. $this->header();
  10. }
  11. public function __destruct()
  12. {
  13. $this->footer();
  14. }
  15. function index($map = [])
  16. {
  17. $this->IN_ACLOG_TYPE = json_decode(IN_ACLOG_TYPE, true);
  18. $_var_0 = SafeRequest("page", "get");
  19. $_var_1 = SafeRequest("user_id", "get");
  20. $_var_1 && ($map[] = ["user_id", "=", $_var_1]);
  21. $this->type = SafeRequest("type", "get");
  22. $this->type && ($map[] = ["type", "=", $this->type]);
  23. $this->search = SafeRequest("search", "get");
  24. $this->search && ($map[] = ["u.in_username|note", "like", "%" . $this->search . "%"]);
  25. $this->mapTime("create_time", true, $map);
  26. $_var_2 = db("user_aclog")->alias("ua")->join("user u", "u.in_userid=ua.user_id")->field("ua.*,u.in_username")->where($map)->order("id desc")->paginate(["page" => $_var_0]);
  27. $_var_3 = $_var_2->items();
  28. $_var_4 = $_var_2->total();
  29. $_var_5 = getRender($_var_2, $_var_0);
  30. ?><div class="container"><?php
  31. $this->nav3();
  32. $this->searchForm("可以输入用户名、描述等关键词进行搜索", "", function () {
  33. ?> <select name="type" onchange="document.btnsearch.submit();">
  34. <option value="">全部类型</option>
  35. <?php
  36. foreach ($this->IN_ACLOG_TYPE as $_var_6 => $_var_7) {
  37. ?> <option value="<?php echo $_var_6;?>" <?php echo $this->type == $_var_6 ? "selected=\"selected\"" : "";?>>
  38. <?php echo $_var_7;?> </option>
  39. <?php
  40. }
  41. ?> </select>
  42. <?php
  43. });
  44. ?>
  45. <table class="layui-table">
  46. <thead>
  47. <tr>
  48. <th>ID</th>
  49. <th>用户</th>
  50. <th>描述</th>
  51. <th>类型</th>
  52. <th>变更前</th>
  53. <th>数值</th>
  54. <th>变更后</th>
  55. <th>变更时间</th>
  56. </tr>
  57. </thead>
  58. <?php
  59. if ($_var_4 == 0) {
  60. ?><tr><td colspan="22" style="margin:auto;text-align:center" >暂无数据</td></tr>
  61. <?php
  62. }
  63. if ($_var_3) {
  64. foreach ($_var_3 as $_var_8) {
  65. ?><tr><td><?php echo $_var_8["id"];?></td><td><?php echo $_var_8["in_username"];?></td><td><?php echo $_var_8["note"];?></td><td><?php echo $this->IN_ACLOG_TYPE[$_var_8["type"]];?></td><td><?php echo str_replace(".00", "", $_var_8["before_value"]);?></td><td><?php echo str_replace(".00", "", $_var_8["value"] > 0 ? "+" . $_var_8["value"] : $_var_8["value"]);?></td><td><?php echo str_replace(".00", "", $_var_8["after_value"]);?></td><td><?php echo date("Y-m-d H:i:s", $_var_8["create_time"]);?></td></tr><?php
  66. }
  67. }
  68. ?></table>
  69. <?php echo $this->render($_var_5);?>
  70. </div>
  71. <?php
  72. }
  73. }