BaseLog.php 961 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace UCore\DcatAdmin\ActionLog;
  3. use App\Module\System\Models\AdminActionlog;
  4. abstract class BaseLog implements InterfaceLog
  5. {
  6. public $objectClass;
  7. public $admin_id;
  8. public $before;
  9. public $after;
  10. public $url;
  11. public $unid = RUN_UNIQID;
  12. public $status = 0;
  13. public $p1 = null;
  14. public function __destruct()
  15. {
  16. $model = new AdminActionlog();
  17. $model->object_class = $this->objectClass;
  18. $model->admin_id = $this->admin_id;
  19. $model->before = $this->before??[];
  20. if(!$this->after){
  21. $this->after = 'is null or empty ';
  22. }
  23. $model->after = $this->after;
  24. $model->url = $this->url;
  25. $model->unid = $this->unid;
  26. $model->type1 = static::TYPE;
  27. $model->status = $this->status;
  28. $model->p1 = serialize($this->p1);
  29. $model->save();
  30. }
  31. }