feat: 添加了查询订单支付状态的API功能
This commit is contained in:
parent
4f7397a1fc
commit
42c7cd4f7e
27
app/admin/controller/IndexController.php
Normal file
27
app/admin/controller/IndexController.php
Normal 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']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user