This commit is contained in:
2026-04-21 17:24:51 +08:00
parent d47ef8d680
commit 4f45ecbd63
13 changed files with 675 additions and 105 deletions
@@ -0,0 +1,47 @@
<?php
declare(strict_types=1);
namespace app\adminapi\controller\finance;
use app\adminapi\controller\BaseAdminController;
use app\adminapi\lists\finance\AccountCostLists;
use app\adminapi\logic\finance\AccountCostLogic;
use app\adminapi\validate\finance\AccountCostValidate;
class AccountCostController extends BaseAdminController
{
public function lists()
{
return $this->dataLists(new AccountCostLists());
}
public function add()
{
$params = (new AccountCostValidate())->post()->goCheck('add');
$result = AccountCostLogic::add($params, $this->adminId, (string) ($this->adminInfo['name'] ?? ''));
if ($result === false) {
return $this->fail(AccountCostLogic::getError());
}
return $this->success('添加成功', [], 1, 1);
}
public function edit()
{
$params = (new AccountCostValidate())->post()->goCheck('edit');
$result = AccountCostLogic::edit($params, $this->adminId, (string) ($this->adminInfo['name'] ?? ''));
if ($result === false) {
return $this->fail(AccountCostLogic::getError());
}
return $this->success('编辑成功', [], 1, 1);
}
public function detail()
{
$params = (new AccountCostValidate())->goCheck('detail');
return $this->data(AccountCostLogic::detail((int) $params['id']));
}
}