PayEnum::BALANCE_PAY]; } switch ($payWay) { case PayEnum::WECHAT_PAY: $auth = UserAuth::where(['user_id' => $order['uid'], 'terminal' => $terminal])->findOrEmpty(); $order = [ 'out_trade_no' => $paySn, 'description' => '商品', 'amount' => [ 'total' => intval($order['actual'] * 100), 'currency' => 'CNY', ], "payer" => [ "openid" => $auth['openid'] ?? 0 ], 'attach' => $from ]; $wechat=new PayService(1); $result = $wechat->wechat->mini($order)->toArray(); break; default: self::$error = '订单异常'; $result = false; } return $result; } }