SystemLog.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\controller\admin\v1\system\log;
  12. use app\controller\admin\AuthController;
  13. use app\services\system\admin\SystemAdminServices;
  14. use app\services\system\log\SystemLogServices;
  15. use think\facade\App;
  16. /**
  17. * 管理员操作记录表控制器
  18. * Class SystemLog
  19. * @package app\controller\admin\v1\system
  20. */
  21. class SystemLog extends AuthController
  22. {
  23. /**
  24. * 构造方法
  25. * SystemLog constructor.
  26. * @param App $app
  27. * @param SystemLogServices $services
  28. */
  29. public function __construct(App $app, SystemLogServices $services)
  30. {
  31. parent::__construct($app);
  32. $this->services = $services;
  33. $this->services->deleteLog();
  34. }
  35. /**
  36. * 显示操作记录
  37. */
  38. public function index()
  39. {
  40. $where = $this->request->getMore([
  41. ['pages', ''],
  42. ['path', ''],
  43. ['ip', ''],
  44. ['admin_id', ''],
  45. ['data', '', '', 'time'],
  46. ]);
  47. return $this->success($this->services->getLogList($where, (int)$this->adminInfo['level']));
  48. }
  49. public function search_admin(SystemAdminServices $services)
  50. {
  51. $info = $services->getOrdAdmin('id,real_name', $this->adminInfo['level']);
  52. return $this->success(compact('info'));
  53. }
  54. }