修改查询助手

This commit is contained in:
mzl
2025-07-22 19:30:27 +08:00
parent b53cfe6bf7
commit 283b21b1f8
3 changed files with 122 additions and 54 deletions
@@ -24,7 +24,7 @@ trait CrudControllerTrait
? [$this, 'indexFormat']
: null);
return $this->success($data);
} catch (\Exception $e) {
} catch (\Throwable $e) {
return $this->error($e->getMessage());
}
}
@@ -44,7 +44,7 @@ trait CrudControllerTrait
? [$this, 'showFormat']
: null);
return $this->success($data);
} catch (\Exception $e) {
} catch (\Throwable $e) {
return $this->error($e->getMessage());
}
}
@@ -61,7 +61,7 @@ trait CrudControllerTrait
$data = $this->validate($this->service->getValidator(), $request->post(), 'store');
$res = $this->service->serviceStore($request, $data);
return $this->success($res, '创建成功');
} catch (\Exception $e) {
} catch (\Throwable $e) {
return $this->error($e->getMessage());
}
}
@@ -78,7 +78,7 @@ trait CrudControllerTrait
$data = $this->validate($this->service->getValidator(), $request->post(), 'update');
$res = $this->service->serviceUpdate($request, $data);
return $this->success([], '更新成功');
} catch (\Exception $e) {
} catch (\Throwable $e) {
return $this->error($e->getMessage());
}
}
@@ -94,7 +94,7 @@ trait CrudControllerTrait
try {
$count = $this->service->serviceDestroy($request);
return $this->success([], "成功删除了 {$count} 条");
} catch (\Exception $e) {
} catch (\Throwable $e) {
return $this->error($e->getMessage());
}
}