Log.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace app\admin\controller\system;
  3. use app\admin\logic\SystemLogLogic;
  4. use app\common\model\SystemLog;
  5. use app\common\controller\AdminController;
  6. use EasyAdmin\annotation\ControllerAnnotation;
  7. use EasyAdmin\annotation\NodeAnotation;
  8. use think\App;
  9. /**
  10. * @ControllerAnnotation(title="操作日志管理")
  11. * Class Auth
  12. * @package app\admin\controller\system
  13. */
  14. class Log extends AdminController
  15. {
  16. public function __construct(App $app)
  17. {
  18. parent::__construct($app);
  19. $this->model = new SystemLog();
  20. }
  21. /**
  22. * @NodeAnotation(title="列表")
  23. */
  24. public function index()
  25. {
  26. if ($this->request->isAjax()) {
  27. if (input('selectFields')) {
  28. return $this->selectList();
  29. }
  30. [$page, $limit, $where, $excludeFields] = $this->buildTableParames(['month']);
  31. list($count, $list) = SystemLogLogic::getList($page, $limit, $where, $excludeFields, $this->sort);
  32. $data = [
  33. 'code' => 0,
  34. 'msg' => '',
  35. 'count' => $count,
  36. 'data' => $list,
  37. ];
  38. return json($data);
  39. }
  40. return $this->fetch();
  41. }
  42. }