心理咨询网
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

SyslogController.php 861B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * @copyright (C)2016-2099 Hnaoyun Inc.
  4. * @author XingMeng
  5. * @email hnxsh@foxmail.com
  6. * @date 2017年3月29日
  7. * 系统日志控制器
  8. */
  9. namespace app\admin\controller\system;
  10. use core\basic\Controller;
  11. use app\admin\model\system\SyslogModel;
  12. class SyslogController extends Controller
  13. {
  14. private $model;
  15. public function __construct()
  16. {
  17. $this->model = new SyslogModel();
  18. }
  19. // 日志列表
  20. public function index()
  21. {
  22. $this->assign('syslogs', $this->model->getList());
  23. $this->display('system/syslog.html');
  24. }
  25. // 清理日志
  26. public function clear()
  27. {
  28. if ($this->model->clearLog()) {
  29. alert_location('清空成功!', url('/admin/Syslog/index'));
  30. } else {
  31. alert_location('清空失败!', url('/admin/Syslog/index'));
  32. }
  33. }
  34. }