2024-07-01 15:57:07 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace app\front;
|
|
|
|
|
|
|
|
use app\config\ResponseCode;
|
|
|
|
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
|
|
|
|
{
|
|
|
|
$params['user_id'] = $request->user_id;
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|