更新统计记录
This commit is contained in:
parent
3c51e97797
commit
b1066b562b
@ -20,6 +20,45 @@ class SendGoodsCode
|
|||||||
$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);
|
||||||
|
}
|
||||||
|
|
||||||
|
//订单收货记录
|
||||||
|
public function recordOrderAddr($order) {
|
||||||
|
//province_code . city_code . district_code . street_code . village_code . brigade_id;
|
||||||
|
//设置地址信息
|
||||||
|
$addressInfo = explode(',', $order['user_address_code'] ?? '');
|
||||||
|
$productOrder = [
|
||||||
|
'uid' => $order['uid'] ?? 0,
|
||||||
|
'order_id' => $order['order_id'] ?? 0,
|
||||||
|
'province_code' => $addressInfo[0] ?? '',
|
||||||
|
'city_code' => $addressInfo[1] ?? '',
|
||||||
|
'district_code' => $addressInfo[2] ?? '',
|
||||||
|
'street_code' => $addressInfo[3] ?? '',
|
||||||
|
'village_code' => $addressInfo[4] ?? '',
|
||||||
|
'brigade_id' => $addressInfo[5] ?? 0,
|
||||||
|
'status' => 1,
|
||||||
|
'create_time' => date('Y-m-d H:i:s')
|
||||||
|
];
|
||||||
|
//商品信息
|
||||||
|
$productInfo = Db::name('store_order_product')->where('order_id', $order['order_id'] ?? 0)->find();
|
||||||
|
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();
|
||||||
|
if ($merchantInfo) {
|
||||||
|
$productOrder['mer_id'] = $merchantInfo['mer_id'] ?? 0;
|
||||||
|
$productOrder['mer_category_id'] = $merchantInfo['category_id'] ?? 0;
|
||||||
|
$productOrder['mer_type_id'] = $merchantInfo['type_id'] ?? 0;
|
||||||
|
$productOrder['is_trader'] = $merchantInfo['is_trader'] ?? 0;
|
||||||
|
}
|
||||||
|
Db::name('ProductOrderLog')->insert($productOrder);
|
||||||
|
Log::info("recordOrderAddr ============= " . json_encode($productOrder));
|
||||||
}
|
}
|
||||||
|
|
||||||
//用户收货码
|
//用户收货码
|
||||||
|
Loading…
x
Reference in New Issue
Block a user