StoreBargainJob.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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\activity;
  12. use app\services\activity\bargain\StoreBargainServices;
  13. use crmeb\basic\BaseJobs;
  14. use crmeb\traits\QueueTrait;
  15. use think\facade\Log;
  16. /**
  17. * 营销:砍价
  18. * Class StoreBargainJob
  19. * @package app\jobs\activity
  20. */
  21. class StoreBargainJob extends BaseJobs
  22. {
  23. use QueueTrait;
  24. /**
  25. * 下单成功修改砍价状态
  26. * @param int $uid
  27. * @param int $bargainId
  28. * @return bool
  29. */
  30. public function setBargainUserStatus(int $uid, int $bargainId)
  31. {
  32. try {
  33. /** @var StoreBargainServices $bargainServices */
  34. $bargainServices = app()->make(StoreBargainServices::class);
  35. $bargainServices->setBargainUserStatus($bargainId, $uid);
  36. } catch (\Throwable $e) {
  37. Log::error('下单成功修改砍价状态失败,失败原因:' . $e->getMessage());
  38. }
  39. return true;
  40. }
  41. }