Files
zzp-server/app/adminapi/controller/finance/RechargeRecordController.php
2026-01-19 14:19:22 +08:00

163 lines
4.6 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\adminapi\controller\finance;
use app\adminapi\controller\BaseAdminController;
use app\adminapi\lists\finance\{RechargeRecordLists,AgentRechargeRecordLists};
use app\adminapi\logic\finance\RechargeRecordLogic;
use app\adminapi\validate\finance\RechargeRecordValidate;
/**
* 充值记录控制器
* Class RechargeRecordController
* @package app\adminapi\controller\finance
*/
class RechargeRecordController extends BaseAdminController
{
/**
* @notes 获取充值记录列表
* @return \think\response\Json
* @author bd
* @date 2024/01/31 14:07
*/
public function lists()
{
return $this->dataLists(new RechargeRecordLists());
}
/**
* @notes 获取代理充值记录列表
* @return \think\response\Json
* @author bd
* @date 2024/01/31 14:07
*/
public function agentLists()
{
return $this->dataLists(new AgentRechargeRecordLists());
}
/**
* @notes 删除充值记录
* @return \think\response\Json
* @author bd
* @date 2024/01/31 14:07
*/
public function delete()
{
$params = (new RechargeRecordValidate())->post()->goCheck('delete');
RechargeRecordLogic::delete($params);
return $this->success('删除成功', [], 1, 1);
}
/**
* @notes 同意充值
* @return \think\response\Json
* @author bd
* @date 2024/01/31 14:07
*/
public function agree()
{
$params = (new RechargeRecordValidate())->post()->goCheck('agree');
$result = RechargeRecordLogic::agree($params['id']);
if (true === $result) {
return $this->success('同意成功', [], 1, 1);
}
return $this->fail(RechargeRecordLogic::getError());
}
/**
* @notes 拒绝充值
* @return \think\response\Json
* @author bd
* @date 2024/01/31 14:07
*/
public function refuse()
{
$params = (new RechargeRecordValidate())->post()->goCheck('refuse');
$result = RechargeRecordLogic::refuse($params['id']);
if (true === $result) {
return $this->success('拒绝成功', [], 1, 1);
}
return $this->fail(RechargeRecordLogic::getError());
}
/**
* @notes 备注
* @return \think\response\Json
* @author bd
* @date 2024/01/31 14:07
*/
public function remark()
{
$params = $this->request->post();
$params['admin_id'] = $this->adminId;
$result = RechargeRecordLogic::remark($params);
if (true === $result) {
return $this->success('备注成功', [], 1, 1);
}
return $this->fail(RechargeRecordLogic::getError());
}
/**
* @notes 修改充值金额
* @return \think\response\Json
* @author bd
* @date 2024/01/31 14:07
*/
public function changeAmount()
{
$params = $this->request->post();
$result = RechargeRecordLogic::changeAmount($params);
if (true === $result) {
return $this->success('修改成功', [], 1, 1);
}
return $this->fail(RechargeRecordLogic::getError());
}
/**
* @notes 新充值提现条数
* @return \think\response\Json
* @author bd
* @date 2024/01/31 14:07
*/
public function warmCount()
{
$result = RechargeRecordLogic::warmCount();
return $this->success('', $result);
}
/**
* @notes 充值统计
* @return \think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author bd
* @date 2024/01/31 14:07
*/
public function stat()
{
$result = RechargeRecordLogic::stat();
return $this->success('', $result);
}
}