文件
xionggeshop/addons/shopro_wechat_trade/job/WxConfirmJob.php

29 行
663 B
PHP

<?php
namespace addons\shopro_wechat_trade\job;
use addons\shopro_wechat_trade\library\WxShippingService;
use think\queue\Job;
class WxConfirmJob
{
public function notify(Job $job, $data)
{
try {
$orderId = intval($data['order_id'] ?? 0);
if ($orderId <= 0) {
$job->delete();
return;
}
(new WxShippingService())->syncOrderConfirm($orderId);
$job->delete();
} catch (\Exception $e) {
if ($job->attempts() >= 3) {
$job->delete();
} else {
$job->release(60);
}
}
}
}