SystemLog.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace app\user\model;
  3. class SystemLog extends Base{
  4. // CREATE TABLE `sys_system_log` (
  5. // `id` bigint(20) NOT NULL AUTO_INCREMENT,
  6. // `system` varchar(255) NOT NULL,
  7. // `controller` varchar(255) NOT NULL,
  8. // `action` varchar(255) NOT NULL,
  9. // `param` text NOT NULL,
  10. // `response` text NOT NULL,
  11. // `action_name` varchar(255) NOT NULL,
  12. // `action_id` int(11) NOT NULL,
  13. // `createTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  14. // PRIMARY KEY (`id`)
  15. // ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
  16. protected $schema = [
  17. 'id' => 'bigint',
  18. 'system' => 'string',
  19. 'controller' => 'string',
  20. 'action' => 'string',
  21. 'param' => 'text',
  22. 'response' => 'text',
  23. 'action_name' => 'string',
  24. 'action_id' => 'int',
  25. 'client_ip'=>'string',
  26. 'createTime' => 'datetime',
  27. ];
  28. protected $json = ['param','response'];
  29. protected $type = [
  30. 'id' => 'integer',
  31. 'createTime' => 'datetime',
  32. ];
  33. protected $createTime = 'createTime';
  34. protected $append=['action_msg'];
  35. public function getActionMsgAttr($value,$data){
  36. return \SystemLog::GET_LOG_PATH($data,$data['action_name'],$data['param']);
  37. }
  38. }