UserLevelJob.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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\user;
  12. use app\services\user\level\UserLevelServices;
  13. use crmeb\basic\BaseJobs;
  14. use crmeb\traits\QueueTrait;
  15. use think\facade\Log;
  16. /**
  17. * 检测会员等级
  18. * Class UserLevelJob
  19. * @package app\jobs\user
  20. */
  21. class UserLevelJob extends BaseJobs
  22. {
  23. use QueueTrait;
  24. public function doJob($uid)
  25. {
  26. try {
  27. /** @var UserLevelServices $levelServices */
  28. $levelServices = app()->make(UserLevelServices::class);
  29. $levelServices->detection((int)$uid);
  30. } catch (\Throwable $e) {
  31. Log::error('会员等级升级失败,失败原因:' . $e->getMessage());
  32. }
  33. return true;
  34. }
  35. }