56 lines
1.3 KiB
PHP
56 lines
1.3 KiB
PHP
<?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
|
|
{
|
|
if (empty($request->user_id)) {
|
|
return responseOk();
|
|
}
|
|
$params['user_id'] = $request->user_id;
|
|
$params['is_retry'] = \app\model\Order::RETRY_STATUS_NO;
|
|
return responseOk(app()->make(OrderService::class)->list($params));
|
|
}
|
|
|
|
/**
|
|
* 订单退订
|
|
* @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);
|
|
echo $res;
|
|
exit;
|
|
}
|
|
|
|
/**
|
|
* @return \think\Response
|
|
* @throws \think\db\exception\DbException
|
|
*/
|
|
public function getMonthSale()
|
|
{
|
|
$res = (new OrderService())->getMonthSale();
|
|
return response_json($res);
|
|
}
|
|
} |