Log.php 721 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace app\admin\controller\crud;
  3. use app\admin\model\CrudLog;
  4. use app\common\controller\Backend;
  5. /**
  6. * crud记录
  7. *
  8. */
  9. class Log extends Backend
  10. {
  11. /**
  12. * Log模型对象
  13. * @var object
  14. * @phpstan-var CrudLog
  15. */
  16. protected object $model;
  17. protected string|array $preExcludeFields = ['id', 'create_time'];
  18. protected string|array $quickSearchField = ['id', 'table_name'];
  19. protected array $noNeedPermission = ['index'];
  20. public function initialize(): void
  21. {
  22. parent::initialize();
  23. $this->model = new CrudLog;
  24. if (!$this->auth->check('crud/crud/index')) {
  25. $this->error(__('You have no permission'), [], 401);
  26. }
  27. }
  28. }