|
@@ -152,6 +152,8 @@ class OrderController extends HomeBaseController |
|
@@ -152,6 +152,8 @@ class OrderController extends HomeBaseController |
152
|
Db::commit();
|
152
|
Db::commit();
|
153
|
//首次下单状态改变
|
153
|
//首次下单状态改变
|
154
|
Db::name('user')->update(['id' => session('user.id'), 'is_first' => 0]);
|
154
|
Db::name('user')->update(['id' => session('user.id'), 'is_first' => 0]);
|
|
|
155
|
+
|
|
|
156
|
+ //微信支付
|
155
|
if ($data['payment'] == 1) {
|
157
|
if ($data['payment'] == 1) {
|
156
|
$info = [
|
158
|
$info = [
|
157
|
'attach' => $oid,
|
159
|
'attach' => $oid,
|
|
@@ -160,9 +162,15 @@ class OrderController extends HomeBaseController |
|
@@ -160,9 +162,15 @@ class OrderController extends HomeBaseController |
160
|
'total_fee' => $final_price
|
162
|
'total_fee' => $final_price
|
161
|
];
|
163
|
];
|
162
|
$this->success('微信支付', url('user/Center/orderDetail', ['oid' => $oid]), $this->wxPay($info));
|
164
|
$this->success('微信支付', url('user/Center/orderDetail', ['oid' => $oid]), $this->wxPay($info));
|
163
|
- } elseif ($data['payment'] == 2) {
|
165
|
+ }
|
|
|
166
|
+
|
|
|
167
|
+ //支付宝支付
|
|
|
168
|
+ elseif ($data['payment'] == 2) {
|
|
|
169
|
+
|
|
|
170
|
+ }
|
164
|
|
171
|
|
165
|
- } elseif ($data['payment'] == 0) {
|
172
|
+ //余额支付
|
|
|
173
|
+ elseif ($data['payment'] == 0) {
|
166
|
$model = new OrderModel;
|
174
|
$model = new OrderModel;
|
167
|
if ($model->orderCallBack($oid)) {
|
175
|
if ($model->orderCallBack($oid)) {
|
168
|
echo json_encode(['msg' => '下单成功', 'code' => 20000]);
|
176
|
echo json_encode(['msg' => '下单成功', 'code' => 20000]);
|