multi-store/app/admin/controller/PurchaseFundsController.php
2025-03-20 14:16:00 +08:00

115 lines
2.7 KiB
PHP

<?php
namespace app\admin\controller;
use app\admin\controller\BaseAdminController;
use app\admin\lists\PurchaseFundsLists;
use app\admin\logic\PurchaseFundsLogic;
use app\admin\validate\PurchaseFundsValidate;
/**
* PurchaseFunds控制器
* Class PurchaseFundsController
* @package app\admin\controller
*/
class PurchaseFundsController extends BaseAdminController
{
/**
* @notes 获取列表
* @author admin
* @date 2025/03/19 14:59
*/
public function lists()
{
return $this->dataLists(new PurchaseFundsLists());
}
/**
* @notes 添加
* @author admin
* @date 2025/03/19 14:59
*/
public function add()
{
$params = (new PurchaseFundsValidate())->post()->goCheck('add');
$result = PurchaseFundsLogic::add($params);
if (true === $result) {
return $this->success('添加成功', [], 1, 1);
}
return $this->fail(PurchaseFundsLogic::getError());
}
/**
* @notes 编辑
* @author admin
* @date 2025/03/19 14:59
*/
public function edit()
{
$params = (new PurchaseFundsValidate())->post()->goCheck('edit');
$result = PurchaseFundsLogic::edit($params);
if (true === $result) {
return $this->success('编辑成功', [], 1, 1);
}
return $this->fail(PurchaseFundsLogic::getError());
}
/**
* @notes 删除
* @author admin
* @date 2025/03/19 14:59
*/
public function delete()
{
$params = (new PurchaseFundsValidate())->post()->goCheck('delete');
PurchaseFundsLogic::delete($params);
return $this->success('删除成功', [], 1, 1);
}
/**
* @notes 获取详情
* @author admin
* @date 2025/03/19 14:59
*/
public function detail()
{
$params = (new PurchaseFundsValidate())->goCheck('detail');
$result = PurchaseFundsLogic::detail($params);
return $this->data($result);
}
/**
* @notes 审核
* @author admin
* @date 2025/03/19 14:59
*/
public function audit()
{
$params = (new PurchaseFundsValidate())->post()->goCheck('delete');
$params['approve_uid'] = $this->adminId;
PurchaseFundsLogic::audit($params);
return $this->success('操作成功', [], 1, 1);
}
/**
* @notes 补充
* @author admin
* @date 2025/03/19 14:59
*/
public function replenish()
{
$params = (new PurchaseFundsValidate())->post()->goCheck('delete');
$params['approve_uid'] = $this->adminId;
PurchaseFundsLogic::replenish($params);
return $this->success('操作成功', [], 1, 1);
}
}