feat: 合同审查轮询方案(先审查后扣积分、HTML报告下载、数据库记录)
This commit is contained in:
@@ -2,13 +2,23 @@
|
||||
module.exports = {
|
||||
main: async (event) => {
|
||||
let { data = {}, userInfo, util } = event;
|
||||
let { db, _ } = util;
|
||||
const { pageIndex = 1, pageSize = 20, type } = data;
|
||||
let { vk, db, _ } = util;
|
||||
const { pageIndex = 1, pageSize = 50, biz_type } = data;
|
||||
|
||||
console.log('getLog uid:', userInfo.uid);
|
||||
|
||||
// 先查全部看看有没有数据
|
||||
const allRes = await db.collection('jjx-points-log').limit(5).get();
|
||||
console.log('getLog all data count:', allRes.data.length);
|
||||
if (allRes.data.length > 0) {
|
||||
console.log('getLog first record:', JSON.stringify(allRes.data[0]));
|
||||
}
|
||||
|
||||
const where = { user_id: userInfo.uid };
|
||||
if (type) where.type = type; // 可选筛选 earn/spend
|
||||
if (biz_type) where.biz_type = biz_type;
|
||||
|
||||
const countRes = await db.collection('jjx-points-log').where(where).count();
|
||||
console.log('getLog filtered count:', countRes.total);
|
||||
|
||||
const listRes = await db.collection('jjx-points-log')
|
||||
.where(where)
|
||||
|
||||
Reference in New Issue
Block a user