first commit
This commit is contained in:
125
app/adminapi/controller/setting/RechargeMethodController.php
Normal file
125
app/adminapi/controller/setting/RechargeMethodController.php
Normal file
@@ -0,0 +1,125 @@
|
||||
<?php
|
||||
namespace app\adminapi\controller\setting;
|
||||
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\setting\RechargeMethodLists;
|
||||
use app\adminapi\logic\setting\RechargeMethodLogic;
|
||||
use app\adminapi\validate\setting\RechargeMethodValidate;
|
||||
|
||||
|
||||
/**
|
||||
* 充值方式控制器
|
||||
* Class RechargeMethodController
|
||||
* @package app\adminapi\controller\setting
|
||||
*/
|
||||
class RechargeMethodController extends BaseAdminController
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取充值方式列表
|
||||
* @return \think\response\Json
|
||||
* @author BD
|
||||
* @date 2023/11/30 15:22
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new RechargeMethodLists());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加充值方式
|
||||
* @return \think\response\Json
|
||||
* @author BD
|
||||
* @date 2023/11/30 15:22
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$params = (new RechargeMethodValidate())->post()->goCheck('add');
|
||||
$result = RechargeMethodLogic::add($params);
|
||||
if (true === $result) {
|
||||
return $this->success('添加成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(RechargeMethodLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 编辑充值方式
|
||||
* @return \think\response\Json
|
||||
* @author BD
|
||||
* @date 2023/11/30 15:22
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$params = (new RechargeMethodValidate())->post()->goCheck('edit');
|
||||
$result = RechargeMethodLogic::edit($params);
|
||||
if (true === $result) {
|
||||
return $this->success('编辑成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(RechargeMethodLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 删除充值方式
|
||||
* @return \think\response\Json
|
||||
* @author BD
|
||||
* @date 2023/11/30 15:22
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$params = (new RechargeMethodValidate())->post()->goCheck('delete');
|
||||
RechargeMethodLogic::delete($params);
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取充值方式详情
|
||||
* @return \think\response\Json
|
||||
* @author BD
|
||||
* @date 2023/11/30 15:22
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$params = (new RechargeMethodValidate())->goCheck('detail');
|
||||
$result = RechargeMethodLogic::detail($params);
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 更改状态
|
||||
* @return \think\response\Json
|
||||
* @author BD
|
||||
* @date 2323/2/22 10:18
|
||||
*/
|
||||
public function updateStatus()
|
||||
{
|
||||
$params = (new RechargeMethodValidate())->post()->goCheck('status');
|
||||
$result = RechargeMethodLogic::updateStatus($params);
|
||||
if (true === $result) {
|
||||
return $this->success('修改成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(RechargeMethodLogic::getError());
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 获取全部充值方式
|
||||
* @return \think\response\Json
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author BD
|
||||
* @date 2323/10/13 10:54
|
||||
*/
|
||||
public function all()
|
||||
{
|
||||
$result = RechargeMethodLogic::getAllData();
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user