Skip to content

Commit

Permalink
支付方式判断
Browse files Browse the repository at this point in the history
  • Loading branch information
shirne committed Oct 24, 2024
1 parent 0b044c7 commit af29520
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/application/index/controller/OrderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,14 @@ public function wechatpay($order_id, $trade_type = 'JSAPI', $payid = 0)
//redirect(url('index/order/wechatpay',['type'=>$payid]))->send();exit;
if (empty($this->wechatUser)) $this->error('请先绑定微信账号', url('index/login/index'));
}
if ($payid == 0 && !empty($this->wechatUser)) $payid = $this->wechatUser['type_id'];

$wechat = WechatModel::where('id', $payid)->where('type', 'wechat')->find();
} else {
$wechat = WechatModel::where('type', 'wechat')->order('is_default desc')->find();
$payid = $wechat['id'];
}
if ($payid == 0 && !empty($this->wechatUser)) $payid = $this->wechatUser['type_id'];
$wechat = WechatModel::where('id', $payid)
->where('type', 'wechat')->find();

if (empty($wechat)) {
$this->error('支付方式错误');
}
Expand Down

0 comments on commit af29520

Please sign in to comment.