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'])); } public function delete() { $params = (new AccountCostValidate())->post()->goCheck('delete'); $result = AccountCostLogic::delete((int) $params['id']); if ($result === false) { return $this->fail(AccountCostLogic::getError()); } return $this->success('删除成功', [], 1, 1); } }