diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php index b03b41809..57876439b 100644 --- a/app/common/logic/PayNotifyLogic.php +++ b/app/common/logic/PayNotifyLogic.php @@ -216,31 +216,32 @@ class PayNotifyLogic extends BaseLogic if ($order->isEmpty() || $order->paid == PayEnum::ISPAID) { return true; } + $order->status = 1; + $order->paid = 1; + $order->pay_time = time(); + if($order['is_storage']==1){ + $order->status=2; + UserProductStorageLogic::add($order); + } if ($order->pay_type != 10) { $order->pay_price = bcdiv($extra['amount']['payer_total'], 100, 2); - $order->paid = 1; - $order->pay_time = time(); - $order->status = 1; - $order->save(); } else { $extra['transaction_id'] = time(); } $user = User::where('id', $order['uid'])->find(); if ($order->pay_type == OrderEnum::CASHIER_ORDER_PAY || $order->pay_type == OrderEnum::CASHIER_ORDER_ALI_PAY) { //收银台支付 $order->status = 2; - $order->save(); self::afterPay($order, $extra['transaction_id']); } else { $capitalFlowDao = new CapitalFlowLogic($user); //微信支付和用户余额无关 $capitalFlowDao->userExpense('user_order_pay', 'order', $order['id'], $order->pay_price, '', 1, $order['store_id']); } - + $order->save(); self::dealProductLog($order); if ($order['shipping_type'] == 3) { self::descStock($order['id']); } - if (!empty($extra['payer']['openid']) && $order->pay_type == 7) { Redis::send('push-delivery', ['order_id' => $order['order_id'], 'openid' => $extra['payer']['openid']], 4); }