AdminLogJob.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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\jobs\system;
  12. use app\services\system\log\SystemLogServices;
  13. use crmeb\basic\BaseJobs;
  14. use crmeb\traits\QueueTrait;
  15. /**
  16. * 后台日志
  17. * Class AdminLogJob
  18. * @package app\jobs\system
  19. */
  20. class AdminLogJob extends BaseJobs
  21. {
  22. use QueueTrait;
  23. /**
  24. * @return mixed
  25. */
  26. public static function queueName()
  27. {
  28. return 'CRMEB_PRO_LOG';
  29. }
  30. /**
  31. * @param $adminId
  32. * @param $adminName
  33. * @param $module
  34. * @param $rule
  35. * @param $ip
  36. * @param $type
  37. */
  38. public function doJob($adminId, $adminName, $module, $rule, $ip, $type)
  39. {
  40. try {
  41. /** @var SystemLogServices $services */
  42. $services = app()->make(SystemLogServices::class);
  43. $services->recordAdminLog((int)$adminId, $adminName, $module, $rule, $ip, $type);
  44. } catch (\Exception $e) {
  45. }
  46. return true;
  47. }
  48. }