UserMoneyJob.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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\UserMoneyServices;
  13. use crmeb\basic\BaseJobs;
  14. use crmeb\traits\QueueTrait;
  15. use think\facade\Log;
  16. /**
  17. * 用户余额
  18. * Class UserMoneyJob
  19. * @package app\jobs
  20. */
  21. class UserMoneyJob extends BaseJobs
  22. {
  23. use QueueTrait;
  24. /**
  25. * 赠送新人礼余额
  26. * @param $uid
  27. * @return bool
  28. */
  29. public function newcomerGiveMoney($uid)
  30. {
  31. try {
  32. /** @var UserMoneyServices $userMoneyServices */
  33. $userMoneyServices = app()->make(UserMoneyServices::class);
  34. $userMoneyServices->newcomerGiveMoney((int)$uid);
  35. } catch (\Throwable $e) {
  36. Log::error('赠送新人礼余额失败,失败原因:' . $e->getMessage());
  37. }
  38. return true;
  39. }
  40. /**
  41. * 会员卡激活赠送余额
  42. * @param $uid
  43. * @return bool
  44. */
  45. public function levelGiveMoney($uid)
  46. {
  47. try {
  48. /** @var UserMoneyServices $userMoneyServices */
  49. $userMoneyServices = app()->make(UserMoneyServices::class);
  50. $userMoneyServices->levelGiveMoney((int)$uid);
  51. } catch (\Throwable $e) {
  52. Log::error('会员卡激活赠送余额失败,失败原因:' . $e->getMessage());
  53. }
  54. return true;
  55. }
  56. }