SysLog.php 828 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. declare (strict_types = 1);
  3. /**
  4. * +----------------------------------------------------------------------
  5. * | 管理员日志控制器
  6. * +----------------------------------------------------------------------
  7. */
  8. namespace app\controller\sys;
  9. // 引入框架内置类
  10. use think\facade\View;
  11. use app\utils\ReUtils;
  12. use app\model\SysLog as SysLogModel;
  13. class SysLog extends Base
  14. {
  15. public function index($limit = 30)
  16. {
  17. $list = SysLogModel::queryPage($limit, 0);
  18. View::assign('list', $list);
  19. return View::fetch();
  20. }
  21. public function delete($id)
  22. {
  23. if ($this->app->request->isPost()) {
  24. if (SysLogModel::destroy($id)) {
  25. return ReUtils::success();
  26. } else {
  27. return ReUtils::error();
  28. }
  29. }
  30. }
  31. }