MiniOrderJob.php 957 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace app\jobs\order;
  3. use crmeb\basic\BaseJobs;
  4. use crmeb\services\wechat\MiniProgram;
  5. use crmeb\traits\QueueTrait;
  6. /**
  7. * 小程序订单处理
  8. */
  9. class MiniOrderJob extends BaseJobs
  10. {
  11. use QueueTrait;
  12. /**
  13. * @param string $out_trade_no
  14. * @param int $logistics_type
  15. * @param array $shipping_list
  16. * @param string $payer_openid
  17. * @param string $path
  18. * @param int $delivery_mode
  19. * @param bool $is_all_delivered
  20. * @return void
  21. */
  22. public function doJob(string $out_trade_no, int $logistics_type, array $shipping_list, string $payer_openid, string $path, int $delivery_mode = 1, bool $is_all_delivered = true)
  23. {
  24. try {
  25. MiniProgram::shippingByTradeNo($out_trade_no, $logistics_type, $shipping_list, $payer_openid, $path, $delivery_mode, $is_all_delivered);
  26. } catch (\Throwable $e) {
  27. \think\facade\Log::error('小程序订单处理失败,原因:' . $e->getMessage());
  28. }
  29. }
  30. }