@xuda.io/account_module 1.2.1566 → 1.2.1568
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 +2 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1918,6 +1918,7 @@ setTimeout(async () => {
|
|
|
1918
1918
|
// console.log(_design.views.ai_chat_usage);
|
|
1919
1919
|
// ret = await set_contact_profile_picture(uid, 'cnt_2d21d55f8f0cdaf65a7a69f69617f532', {}, null, {});
|
|
1920
1920
|
// ret = await get_picture_cache(uid, 'chat_thumbnail', 'word five title');
|
|
1921
|
+
add_ai_credits_to_active_accounts();
|
|
1921
1922
|
console.log(ret);
|
|
1922
1923
|
}, 1000);
|
|
1923
1924
|
|
|
@@ -3120,7 +3121,7 @@ export const add_ai_credits_to_active_accounts = async function () {
|
|
|
3120
3121
|
year: 'numeric',
|
|
3121
3122
|
});
|
|
3122
3123
|
debugger;
|
|
3123
|
-
const active_accounts = await db_module.find_couch_query('xuda_accounts', { selector: { stat: 3, docType: 'account', last_free_daily_ai_credit_ts: { $lt: Date.now() - 1000 * 60 * 60 * 24 } }, limit: 99999 });
|
|
3124
|
+
const active_accounts = await db_module.find_couch_query('xuda_accounts', { selector: { stat: 3, docType: 'account', last_free_daily_ai_credit_ts: { $lt: Date.now() - 1000 * 60 * 60 * 24 }, membership_plan: 'free' }, limit: 99999 });
|
|
3124
3125
|
for await (account_doc of active_accounts.docs) {
|
|
3125
3126
|
const ret = await record_ai_credit('system', 1, 'daily credit', 'free daily credit ' + date_str, account_doc._id);
|
|
3126
3127
|
if (ret.code > -1) {
|