@xuda.io/account_module 1.2.967 → 1.2.968
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.mjs +7 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -484,10 +484,16 @@ export const get_account_data = async function (req) {
|
|
|
484
484
|
|
|
485
485
|
const app_id = await account_module.get_account_default_project_id(uid);
|
|
486
486
|
|
|
487
|
+
const d = Date.now(); // directly use milliseconds
|
|
488
|
+
|
|
489
|
+
const month = Number(String(date.getMonth() + 1).padStart(2, '0')); // months are 0-based
|
|
490
|
+
const year = date.getFullYear();
|
|
491
|
+
|
|
487
492
|
const ai_usage = await db_module.get_app_couch_view(app_id, 'ai_chat_usage', {
|
|
488
493
|
startkey: req.recipient,
|
|
489
494
|
endkey: 'ZZZZZZZZZZZZ',
|
|
490
|
-
|
|
495
|
+
reduce: true,
|
|
496
|
+
group_level: 999,
|
|
491
497
|
});
|
|
492
498
|
|
|
493
499
|
let membership_plan = 0;
|