You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Log.php 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. namespace app\controller\store\system;
  3. use app\controller\store\AuthController;
  4. use app\services\store\SystemStoreStaffServices;
  5. use app\services\system\log\SystemLogServices;
  6. use think\db\exception\DataNotFoundException;
  7. use think\db\exception\DbException;
  8. use think\db\exception\ModelNotFoundException;
  9. use think\facade\App;
  10. /**
  11. * Class Log
  12. * @package app\controller\store\system
  13. */
  14. class Log extends AuthController
  15. {
  16. /**
  17. * Log constructor.
  18. * @param App $app
  19. * @param SystemLogServices $services
  20. */
  21. public function __construct(App $app, SystemLogServices $services)
  22. {
  23. parent::__construct($app);
  24. $this->services = $services;
  25. $this->services->deleteLog();
  26. }
  27. /**
  28. * 显示操作记录
  29. */
  30. public function index()
  31. {
  32. $where = $this->request->getMore([
  33. ['pages', ''],
  34. ['path', ''],
  35. ['ip', ''],
  36. ['admin_id', ''],
  37. ['data', '', '', 'time'],
  38. ]);
  39. $where['store_id'] = $this->storeId;
  40. return $this->success($this->services->getLogList($where, (int)$this->storeStaffInfo['level']));
  41. }
  42. /**
  43. * 获取
  44. * @param SystemStoreStaffServices $services
  45. * @return mixed
  46. * @throws DataNotFoundException
  47. * @throws DbException
  48. * @throws ModelNotFoundException
  49. */
  50. public function search_admin(SystemStoreStaffServices $services)
  51. {
  52. $info = $services->getOrdAdmin('id,staff_name', $this->storeId, $this->storeStaffInfo['level']);
  53. return $this->success(compact('info'));
  54. }
  55. }