调整线下扫码支付
This commit is contained in:
parent
014cd84106
commit
109a1b1dd2
@ -228,19 +228,10 @@ class StoreOrderRepository extends BaseRepository
|
||||
$svipDiscount = 0;
|
||||
$financeDao = new FinancialDao();
|
||||
foreach ($groupOrder->orderList as $_k => $order) {
|
||||
$isPickupCard = $order->source == 999;
|
||||
(new StoreActivityDao())->saveOrderProduct(2, $order);
|
||||
$order->paid = 1;
|
||||
$order->pay_time = $time;
|
||||
if ($order->source == 999) {
|
||||
$order->status = 3;
|
||||
//订单确认收货,增加商户销售金额
|
||||
Merchant::where('mer_id', $order->mer_id)->update(['sale_amount' => Db::raw('sale_amount+' . $order->total_price)]);
|
||||
//订单确认收货,增加商户采购金额
|
||||
$merId = Merchant::where('uid', $order->uid)->value('mer_id');
|
||||
if (!empty($merId)) {
|
||||
Merchant::where('mer_id', $merId)->update(['purchase_amount' => Db::raw('purchase_amount+' . $order->total_price)]);
|
||||
}
|
||||
}
|
||||
$svipDiscount = bcadd($order->svip_discount, $svipDiscount, 2);
|
||||
if (isset($subOrders[$order->order_sn])) {
|
||||
$order->transaction_id = $subOrders[$order->order_sn]['transaction_id'];
|
||||
@ -353,6 +344,16 @@ class StoreOrderRepository extends BaseRepository
|
||||
// 商户收入金额
|
||||
$financeDao->platformOut($_payPrice, 'merchant_order', $order['mer_id']);
|
||||
|
||||
if ($isPickupCard) {
|
||||
//订单确认收货,增加商户销售金额
|
||||
Merchant::where('mer_id', $order->mer_id)->update(['sale_amount' => Db::raw('sale_amount+' . $_payPrice)]);
|
||||
//订单确认收货,增加商户采购金额
|
||||
$merId = Merchant::where('uid', $order->uid)->value('mer_id');
|
||||
if (!empty($merId)) {
|
||||
Merchant::where('mer_id', $merId)->update(['purchase_amount' => Db::raw('purchase_amount+' . $_payPrice)]);
|
||||
}
|
||||
}
|
||||
|
||||
if ($is_combine) {
|
||||
$profitsharing[] = [
|
||||
'profitsharing_sn' => $storeOrderProfitsharingRepository->getOrderSn(),
|
||||
@ -377,7 +378,7 @@ class StoreOrderRepository extends BaseRepository
|
||||
$this->autoPrinter($order->order_id, $order->mer_id);
|
||||
|
||||
//判断是否是平台购物卡
|
||||
if ($order->orderProduct[0]->product->isPlatformCard()) {
|
||||
if ($order->orderProduct[0]->product->isPlatformCard() || $isPickupCard) {
|
||||
//购物卡自动发货
|
||||
$deliveryData = [
|
||||
'delivery_type' => 3,
|
||||
@ -386,6 +387,9 @@ class StoreOrderRepository extends BaseRepository
|
||||
'delivery_id' => '',
|
||||
];
|
||||
$this->runDelivery($order['order_id'], $order['mer_id'], $deliveryData, ['is_split' => 0, 'split' => []], 'delivery');
|
||||
if ($isPickupCard) {
|
||||
$this->takeOrder($order['order_id'], $order->user);
|
||||
}
|
||||
}
|
||||
}
|
||||
//分销判断
|
||||
@ -770,8 +774,9 @@ class StoreOrderRepository extends BaseRepository
|
||||
'mark' => $order->merchant['mer_name'] . '成功销售' . floatval($order['pay_price']) . '元,奖励推广佣金' . floatval($promoterCommission['number']),
|
||||
'balance' => 0
|
||||
]);
|
||||
$userRepository = app()->make(UserRepository::class);
|
||||
$userRepository->incBrokerage($promoterCommission['user_id'], $promoterCommission['number']);
|
||||
|
||||
$balance = bcadd($user->now_money, $promoterCommission['number'], 2);
|
||||
$user->save(['now_money' => $balance]);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user