added xlsx js for excel

This commit is contained in:
2026-07-20 22:06:10 +08:00
parent c85641371e
commit 2c12b5a6c3
4 changed files with 219 additions and 6 deletions
+2 -1
View File
@@ -110,11 +110,12 @@ async function paginate(model, req, {
const attributes = modelToAttributes(model, { exclude: excludeAttributes, jsonbSchemas, context });
const ALLOWED_FIELDS = attributes.map((a) => a.field);
const computedFieldKeys = computedAttributes.map((c) => c.key);
const dateFieldKeys = attributes.filter((a) => a.type === 'date').map((a) => a.field);
// Sequelize aliases the main model's table with the model's name by default
// (e.g. `FROM "users" AS "User"`) — needed to qualify Sequelize.col()
// references so they don't collide with same-named columns on joined tables.
const { where, order } = buildQuery(filters, sort, ALLOWED_FIELDS, computedFieldKeys, model.name);
const { where, order } = buildQuery(filters, sort, ALLOWED_FIELDS, computedFieldKeys, model.name, dateFieldKeys);
// Build attribute includes: jsonb + audit subqueries + any extra from findOptions
const baseIncludes = jsonbAttr ? [jsonbAttr] : [];