'like', 'store_id' => '=', 'status' => '=', 'period_start' => 'betweenDate', ]; /** 对账单列表 */ #[GetRoute(authorize: 'query')] public function query(Request $request): JsonResponse { $params = $request->all(); $pageSize = $params['pageSize'] ?? 10; $data = $this->buildSearch($params, StatementModel::query()->with('store:id,name')) ->orderBy('id', 'desc') ->paginate($pageSize) ->toArray(); return $this->success($data); } /** 对账单详情(含明细) */ #[GetRoute(route: '/{id}', authorize: 'query', where: ['id' => '[0-9]+'])] public function detail(int $id): JsonResponse { $statement = StatementModel::with(['store:id,name', 'items'])->find($id); if (empty($statement)) { throw new RepositoryException('对账单不存在'); } return $this->success($statement->toArray()); } }