更新支付回调

This commit is contained in:
yaooo 2023-09-08 13:22:46 +08:00
commit c5f440a462

View File

@ -13,7 +13,7 @@
namespace crmeb\jobs; namespace crmeb\jobs;
use app\common\repositories\store\order\StoreOrderRepository;
use crmeb\interfaces\JobInterface; use crmeb\interfaces\JobInterface;
use think\facade\Log; use think\facade\Log;
use think\facade\Db; use think\facade\Db;
@ -27,16 +27,20 @@ class SendGoodsCodeJob implements JobInterface
public function fire($job, $data) public function fire($job, $data)
{ {
$this->event = $data; $this->event = $data;
Log::info("sendGoodsCodeJob" . json_encode($this->event));
Log::info("sendGoodsCodeJob ============= handle监听order_id " . $this->event['order_id']); Log::info("sendGoodsCodeJob ============= handle监听order_id " . $this->event['order_id']);
if ($this->event['activity_type'] == 0) { try {
//发起物流信息返回快递员手机 if ($this->event['activity_type'] == 0) {
$logisticsPhone = $this->sendLogistics($this->event['order_id'], $this->event['order_sn']); //发起物流信息返回快递员手机
//生成用户的收货码 $logisticsPhone = $this->sendLogistics($this->event['order_id'], $this->event['order_sn']);
$this->generateLogisticsCode($this->event['uid'], $this->event['order_id'], $this->event['order_sn'], $logisticsPhone); //生成用户的收货码
//记录订单收货地址记录 $this->generateLogisticsCode($this->event['uid'], $this->event['order_id'], $this->event['order_sn'], $logisticsPhone);
$this->recordOrderAddr($this->event); //记录订单收货地址记录
$this->recordOrderAddr($this->event);
}
} catch (\Exception $e) {
Log::info('sendGoodsCodeJob 异常:' . $e->getMessage());
} }
$job->delete(); $job->delete();
} }
@ -54,16 +58,16 @@ class SendGoodsCodeJob implements JobInterface
'street_code' => $addressInfo[3] ?? '', 'street_code' => $addressInfo[3] ?? '',
'village_code' => $addressInfo[4] ?? '', 'village_code' => $addressInfo[4] ?? '',
'brigade_id' => $addressInfo[5] ?? 0, 'brigade_id' => $addressInfo[5] ?? 0,
'product_id' => 0,
'product_price' => 0,
'total_price' => $order['pay_price'] ?? 0,
'product_num' => $order['total_num'] ?? 0,
'status' => 1, 'status' => 1,
'create_time' => date('Y-m-d H:i:s') 'create_time' => date('Y-m-d H:i:s')
]; ];
//商品信息 //商品信息
$productInfo = Db::name('store_order_product')->where('order_id', $order['order_id'] ?? 0)->find(); $productInfo = Db::name('store_order_product')->where('order_id', $order['order_id'] ?? 0)->find();
if ($productInfo) { if ($productInfo) {
$productOrder['product_id'] = $productInfo['product_id'] ?? 0;
$productOrder['product_price'] = $productInfo['product_price'] ?? 0;
$productOrder['total_price'] = $productInfo['total_price'] ?? 0;
$productOrder['product_num'] = $productInfo['product_num'] ?? 0;
} }
//商户信息 //商户信息
$merchantInfo = Db::name('merchant')->where('mer_id', $order['mer_id'] ?? 0)->find(); $merchantInfo = Db::name('merchant')->where('mer_id', $order['mer_id'] ?? 0)->find();