getFile(), $e->getLine(), $e->getMessage() ])); self::setError($e->getMessage()); return $e->getMessage(); } } /** * @notes 零售回调 * @param $orderSn * @param array $extra * @author 段誉 * @date 2023/2/27 15:28 */ public static function cashierclass($orderSn, $extra = []) { $order = Cashierclass::where('number', $orderSn)->findOrEmpty(); if ($order->isEmpty() || $order->paid == PayEnum::ISPAID) { return true; } $order->money = bcdiv($extra['amount']['payer_total'], 100, 2); $order->paid = 1; $order->status = 1; if ($order->pay_type == 9) { $order->status = 2; } $order->save(); if ($order['cart_id']) { if (!is_array($order['cart_id'])) { $cart_arr = explode(',', $order['cart_id']); Cart::whereIn('cart_id', $cart_arr)->update(['is_pay' => 1]); } else { Cart::whereIn('cart_id', $order['cart_id'])->update(['is_pay' => 1]); } } PushService::push('cash_register_' . $order['user_id'], $order['user_id'], '您有一笔订单已支付'); if (!empty($extra['payer']['openid']) && $order->pay_type != 9) { Redis::send('push-delivery',['order_id'=>$orderSn,'openid'=>$extra['payer']['openid']],5); } return true; } }