cmbYouku_Api/app/front/Order.php

56 lines
1.3 KiB
PHP
Raw Normal View History

2024-07-01 15:57:07 +08:00
<?php
namespace app\front;
use app\service\CmbService;
use app\service\OrderService;
use app\service\RechargeService;
use think\Request;
class Order extends Base
{
public function list(Request $request): \think\Response
{
2024-07-08 15:26:18 +08:00
if (empty($request->user_id)) {
return responseOk();
}
2024-07-01 15:57:07 +08:00
$params['user_id'] = $request->user_id;
2024-07-08 15:26:18 +08:00
$params['is_retry'] = \app\model\Order::RETRY_STATUS_NO;
2024-07-01 15:57:07 +08:00
return responseOk(app()->make(OrderService::class)->list($params));
}
2024-07-05 15:22:57 +08:00
2024-07-01 15:57:07 +08:00
/**
* 订单退订
* @param Request $request
* @return \think\Response
*/
public function refund(Request $request)
{
$orderNumber = $request->post('order_number');
$res = CmbService::refund($orderNumber);
return response_json($res);
}
/**
* 直连天下充值回调
* @param Request $request
* @return string
*/
public function rechargeNotify(Request $request)
{
$params = $request->post();
$res = (new RechargeService())->rechargeNotify($params);
2024-07-05 15:22:57 +08:00
echo $res;
2024-07-01 15:57:07 +08:00
exit;
}
/**
* @return \think\Response
* @throws \think\db\exception\DbException
*/
public function getMonthSale()
{
$res = (new OrderService())->getMonthSale();
return response_json($res);
}
}