|
@@ -3,6 +3,7 @@
|
|
|
namespace app\api\controller\pay;
|
|
|
|
|
|
use app\model\Order;
|
|
|
+use app\model\PayDetail;
|
|
|
use support\Request;
|
|
|
use Yansongda\Pay\Exceptions\BusinessException;
|
|
|
use Yansongda\Pay\Pay;
|
|
@@ -17,14 +18,14 @@ class WxpayController
|
|
|
return json_fail('参数异常');
|
|
|
}
|
|
|
$orderId = $params['order_id'];
|
|
|
- $order = Order::where('order_id', $orderId)->where('order_status_payment', 'PENDING')->first();
|
|
|
- if (!$order) {
|
|
|
+ $payDetail = PayDetail::where('join_pay_order_id',$orderId)->where('pay_status','PENDING')->first();
|
|
|
+ if (!$payDetail) {
|
|
|
return json_fail('订单异常');
|
|
|
}
|
|
|
$payData = [
|
|
|
'out_trade_no' => $orderId,
|
|
|
'body' => '万悦康养订单',
|
|
|
- 'total_fee' => $order->order_amount_pay * 100,
|
|
|
+ 'total_fee' => $payDetail->pay_amount * 100,
|
|
|
];
|
|
|
|
|
|
try {
|