b6cd08740fa61eb6123ac66ebc608e2ced73f38e.svn-base 804 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /*
  3. |--------------------------------------------------------------------------
  4. | log.php 后台操作日志
  5. |--------------------------------------------------------------------------
  6. */
  7. namespace MazeApp\Manage\Lib;
  8. use Maze;
  9. class Log
  10. {
  11. /**
  12. * 记录后台操作日志
  13. *
  14. * @return string
  15. */
  16. static public function add($project, $table, $info, $tid)
  17. {
  18. $data['操作'] = $info['method'];
  19. $data['TID'] = $tid;
  20. $data['时间'] = date('Y-m-d H:i:s');
  21. $data += $info['input'];
  22. $admin = Maze::load('manage/auth.info');
  23. $param['add_project'] = $project;
  24. $param['add_table'] = $table;
  25. $param['add_info'] = base64_encode(Maze::table($data));
  26. $param['add_admin'] = $admin['id'];
  27. $param['add_tid'] = $tid;
  28. return Maze::load('manage/log-insert', $param);
  29. }
  30. }