SystemLog.php 518 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace app\admin\model;
  3. use app\admin\service\SystemLogService;
  4. use app\common\model\TimeModel;
  5. use think\model\relation\BelongsTo;
  6. class SystemLog extends TimeModel
  7. {
  8. protected array $type = [
  9. 'content' => 'json',
  10. 'response' => 'json',
  11. ];
  12. protected function init(): void
  13. {
  14. SystemLogService::instance()->detectTable();
  15. }
  16. public function admin(): BelongsTo
  17. {
  18. return $this->belongsTo('app\admin\model\SystemAdmin', 'admin_id', 'id');
  19. }
  20. }