|
|
@ -54,7 +54,7 @@ class Pay extends Common |
|
|
|
$this->error('已下单成功'); |
|
|
|
$this->error('已下单成功'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!$payment || !in_array($payment, ['wechat', 'alipay', 'money', 'offline'])) { |
|
|
|
if (!$payment || !in_array($payment, ['wechat', 'alipay', 'money', 'offline','score'])) { |
|
|
|
$this->error('支付类型不能为空'); |
|
|
|
$this->error('支付类型不能为空'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -115,6 +115,23 @@ class Pay extends Common |
|
|
|
$this->success('订单支付成功', $order); |
|
|
|
$this->success('订单支付成功', $order); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//商城订单积分支付 |
|
|
|
|
|
|
|
if ($payment == 'score' && $order_type == 'order') { |
|
|
|
|
|
|
|
// 积分支付 |
|
|
|
|
|
|
|
$order = Db::transaction(function () use ($payOper, $order, $order_type) { |
|
|
|
|
|
|
|
// 加锁读订单 |
|
|
|
|
|
|
|
$order = $order->lock(true)->find($order->id); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$order = $payOper->score($order, $order->remain_pay_fee, $order_type); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $order; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
if ($order->status != $order::STATUS_PAID) { |
|
|
|
|
|
|
|
$this->error('订单支付失败'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
$this->success('订单支付成功', $order); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 微信支付宝(第三方)付款 |
|
|
|
// 微信支付宝(第三方)付款 |
|
|
|
$payModel = $payOper->{$payment}($order, $order->remain_pay_fee, $order_type); |
|
|
|
$payModel = $payOper->{$payment}($order, $order->remain_pay_fee, $order_type); |
|
|
|
|
|
|
|
|
|
|
|