data_center/app/adminapi/controller/finance/RefundController.php

88 lines
2.4 KiB
PHP
Raw Normal View History

2023-09-18 09:11:13 +08:00
<?php
namespace app\adminapi\controller\finance;
use app\adminapi\controller\BaseAdminController;
use app\adminapi\lists\finance\RefundLogLists;
use app\adminapi\lists\finance\RefundRecordLists;
use app\adminapi\logic\finance\RefundLogic;
2023-11-15 17:32:00 +08:00
use think\response\Json;
2023-09-18 09:11:13 +08:00
/**
* 退款控制器
* Class RefundController
* @package app\adminapi\controller\finance
*/
class RefundController extends BaseAdminController
{
/**
* @notes 退还统计
* @return \think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author 段誉
* @date 2023/3/3 12:10
*/
public function stat()
{
$result = RefundLogic::stat();
return $this->success('', $result);
}
2023-11-15 17:32:00 +08:00
public function taskStat(): Json
{
$params=$this->request->get();
$result = curl_post(env('project.worker_domain').'/middleapi/refund/stat',$params,$this->reqHeader);
if($result['code'] == 0){
return $this->fail($result['msg']);
}
return json($result);
}
2023-09-18 09:11:13 +08:00
/**
* @notes 退款记录
* @return \think\response\Json
* @author 段誉
* @date 2023/3/1 9:47
*/
public function record()
{
return $this->dataLists(new RefundRecordLists());
}
2023-11-15 17:32:00 +08:00
public function taskRecord(): Json
{
$params=$this->request->get(['user_info', 'start_time', 'end_time', 'sn', 'order_sn']);
$result = curl_post(env('project.worker_domain').'/middleapi/refund/record',$params,$this->reqHeader);
if($result['code'] == 0){
return $this->fail($result['msg']);
}
return json($result);
}
2023-09-18 09:11:13 +08:00
/**
* @notes 退款日志
* @return \think\response\Json
* @author 段誉
* @date 2023/3/1 9:47
*/
public function log()
{
$recordId = $this->request->get('record_id', 0);
$result = RefundLogic::refundLog($recordId);
return $this->success('', $result);
}
2023-11-15 17:32:00 +08:00
public function taskLog(): Json
{
$params=$this->request->get(['record_id']);
$result = curl_post(env('project.worker_domain').'/middleapi/refund/log',$params,$this->reqHeader);
if($result['code'] == 0){
return $this->fail($result['msg']);
}
return json($result);
}
2023-09-18 09:11:13 +08:00
}