System.php 825 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. declare (strict_types = 1);
  3. /**
  4. * +----------------------------------------------------------------------
  5. * | 管理员日志控制器
  6. * +----------------------------------------------------------------------
  7. */
  8. namespace app\sys\controller;
  9. // 引入框架内置类
  10. use think\facade\View;
  11. use app\common\model\System as SystemModel;
  12. class System extends Base
  13. {
  14. public function index()
  15. {
  16. $list = SystemModel::select();
  17. View::assign('list', $list);
  18. return View::fetch();
  19. }
  20. public function delete($id)
  21. {
  22. if ($this->app->request->isPost()) {
  23. if (SystemModel::destroy($id)) {
  24. return ['code' => 1,'msg'=>'删除成功'];
  25. } else {
  26. return ['code' => 0,'msg'=>'删除失败'];
  27. }
  28. }
  29. }
  30. }