MiniOrderJob.php 803 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace app\jobs;
  3. use crmeb\basic\BaseJobs;
  4. use crmeb\services\easywechat\orderShipping\MiniOrderService;
  5. use crmeb\traits\QueueTrait;
  6. use EasyWeChat\Core\Exceptions\HttpException;
  7. use think\Exception;
  8. class MiniOrderJob extends BaseJobs
  9. {
  10. use QueueTrait;
  11. /**
  12. * @throws HttpException
  13. */
  14. 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)
  15. {
  16. try {
  17. MiniOrderService::shippingByTradeNo($out_trade_no, $logistics_type, $shipping_list, $payer_openid, $path, $delivery_mode, $is_all_delivered);
  18. } catch (HttpException $e) {
  19. // 订单异常处理
  20. throw new HttpException($e);
  21. }
  22. }
  23. }