|
@@ -231,13 +231,11 @@ class OrderController extends Controller
|
|
|
if (!$source['redirect']['url']) {
|
|
|
abort(500, '支付网关请求失败');
|
|
|
}
|
|
|
-
|
|
|
- Redis::set($source['id'], $order->trade_no);
|
|
|
- Redis::expire($source['id'], 3600);
|
|
|
- $order->callback_no = $source['id'];
|
|
|
- if (!$order->save()) {
|
|
|
- abort(500, '订单更新失败');
|
|
|
+
|
|
|
+ if (!Redis::set($source['id'], $order->trade_no)) {
|
|
|
+ abort(500, '订单创建失败');
|
|
|
}
|
|
|
+ Redis::expire($source['id'], 3600);
|
|
|
return $source['redirect']['url'];
|
|
|
}
|
|
|
|
|
@@ -258,13 +256,10 @@ class OrderController extends Controller
|
|
|
if (!$source['wechat']['qr_code_url']) {
|
|
|
abort(500, '支付网关请求失败');
|
|
|
}
|
|
|
-
|
|
|
- Redis::set($source['id'], $order->trade_no);
|
|
|
- Redis::expire($source['id'], 3600);
|
|
|
- $order->callback_no = $source['id'];
|
|
|
- if (!$order->save()) {
|
|
|
- abort(500, '订单更新失败');
|
|
|
+ if (!Redis::set($source['id'], $order->trade_no)) {
|
|
|
+ abort(500, '订单创建失败');
|
|
|
}
|
|
|
+ Redis::expire($source['id'], 3600);
|
|
|
return $source['wechat']['qr_code_url'];
|
|
|
}
|
|
|
}
|