feat: 添加了查询订单支付状态的API功能

This commit is contained in:
mkm 2024-07-04 13:58:59 +08:00
parent 4f7397a1fc
commit 42c7cd4f7e

View File

@ -0,0 +1,27 @@
<?php
namespace app\admin\controller;
use app\common\service\pay\PayService;
class IndexController extends BaseAdminController
{
/**
* @notes 查询订单支付状态
*/
public function wechatQuery()
{
$order_no = $this->request->get('order_no');
$order = [
'out_trade_no' => $order_no,
];
$app = new PayService(0);
try {
$res = $app->wechat->query($order);
return $this->success('查询成功', $res->toArray());
} catch (\Exception $e) {
return $this->fail($e->extra['message']);
}
}
}