作者 lihan
1 个管道 的构建 通过 耗费 0 秒

赠送优惠券

@@ -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]);
@@ -2,5 +2,7 @@ @@ -2,5 +2,7 @@
2 return 2 return
3 [ 3 [
4 'AppID' => 'wx89d9ac6d013cfe38', 4 'AppID' => 'wx89d9ac6d013cfe38',
5 - 'AppSecret' => '01df709fc22b33d9f78b2f4023aa8dc2' 5 + 'AppSecret' => '01df709fc22b33d9f78b2f4023aa8dc2',
  6 + 'MchId' => '1507647501',
  7 + 'Key' => '94643738277625076870483309666648'
6 ]; 8 ];