diff --git a/app/api/controller/Pay.php b/app/api/controller/Pay.php index bd66d65..893e449 100644 --- a/app/api/controller/Pay.php +++ b/app/api/controller/Pay.php @@ -60,12 +60,18 @@ class Pay extends Api //会员订单 if($trader_order['type'] == 1){ $order = OrderUser::where('trade_id', $post['order_id'])->findOrEmpty(); + if($order){ + $order['order_amount'] = $order['pay_money']; + } // 更新支付方式 OrderUser::where('trade_id', $post['order_id'])->update(['pay_way' => $post['pay_way']]); } //资料订单 if($trader_order['type'] == 2){ $order = OrderResource::where('trade_id', $post['order_id'])->findOrEmpty(); + if($order){ + $order['order_amount'] = $order['pay_money']; + } // 更新支付方式 OrderResource::where('trade_id', $post['order_id'])->update(['pay_way' => $post['pay_way']]); } diff --git a/app/api/logic/OrderLogic.php b/app/api/logic/OrderLogic.php index ebbc6f1..832a28a 100644 --- a/app/api/logic/OrderLogic.php +++ b/app/api/logic/OrderLogic.php @@ -1885,6 +1885,7 @@ class OrderLogic extends Logic ->field(['ot.id', 'ot.t_sn as order_sn', 'o.pay_time', 'o.pay_way', 'ot.total_amount']) ->findOrEmpty() ->toArray(); + $result['total_amount'] = '¥' . $result['total_amount']; break; diff --git a/app/common/server/WeChatPayServer.php b/app/common/server/WeChatPayServer.php index fc7bbff..99e652e 100644 --- a/app/common/server/WeChatPayServer.php +++ b/app/common/server/WeChatPayServer.php @@ -106,6 +106,7 @@ class WeChatPayServer $app = Factory::payment($config); $attributes = self::getAttributes($from, $order, $order_source, $auth, $notify_url); + var_dump($attributes);die; $result = $app->order->unify($attributes); if ($result['return_code'] == 'SUCCESS' && $result['result_code'] == 'SUCCESS') { @@ -335,7 +336,6 @@ class WeChatPayServer $app = new Application($config); $response = $app->handlePaidNotify(function ($message, $fail) { - if ($message['return_code'] !== 'SUCCESS') { return $fail('通信失败'); }