This commit is contained in:
Aether
2025-09-26 17:16:12 +08:00
parent f3a672b5c9
commit d7880f99c9
3 changed files with 6 additions and 5 deletions

View File

@@ -46,12 +46,13 @@ class DataService implements DataServiceInterface
public function updateCampus(int $id, array $data): int
{
// TODO: Implement updateCampus() method.
$this->campusValidator->scene('update', $data)->check();
return $this->campusModel->updateById($id, $data);
}
public function deleteCampus(int $id): bool
{
// TODO: Implement deleteCampus() method.
return $this->campusModel->deleteById($id);
}
public function getCampusById(int $id): array

View File

@@ -157,9 +157,9 @@ abstract class AetherModel extends HyperfModel implements CacheableInterface
/**
* 快捷更新.
*/
public static function updateById(int $id, array $data): bool
public static function updateById(int $id, array $data): int
{
return static::query()->where('id', $id)->update($data) > 0;
return static::query()->where('id', $id)->update($data);
}
/**

View File

@@ -19,7 +19,7 @@ class RpcExceptionHandler extends ExceptionHandler
/**
*/
public function handle(Throwable $throwable, ResponseInterface $response): ResponseInterface
{
{var_dump($throwable->getMessage());
try {
// 获取请求ID用于日志追踪
$requestId = Context::get('request_id', '');