UnpaidOrderSend.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2023 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;
  12. use app\services\order\StoreOrderServices;
  13. use crmeb\basic\BaseJobs;
  14. use crmeb\traits\QueueTrait;
  15. /**
  16. * 未支付10分钟后发送短信
  17. * Class UnpaidOrderSend
  18. * @package crmeb\jobs
  19. */
  20. class UnpaidOrderSend extends BaseJobs
  21. {
  22. use QueueTrait;
  23. public function doJob($id)
  24. {
  25. /** @var StoreOrderServices $services */
  26. $services = app()->make(StoreOrderServices::class);
  27. $orderInfo = $services->get($id);
  28. if (!$orderInfo) {
  29. return true;
  30. }
  31. if ($orderInfo->paid) {
  32. return true;
  33. }
  34. if ($orderInfo->is_del) {
  35. return true;
  36. }
  37. //收货给用户发送消息
  38. event('NoticeListener', [['order' => $orderInfo], 'order_pay_false']);
  39. return true;
  40. }
  41. }