feat: 新增AI客服/积分管理/合同审查/我的报告页面,完善.sign.vue入口与积分显示
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
//查询积分流水
|
||||
module.exports = {
|
||||
main: async (event) => {
|
||||
let { data = {}, userInfo, util } = event;
|
||||
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 (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)
|
||||
.orderBy('_add_time', 'desc')
|
||||
.skip((pageIndex - 1) * pageSize)
|
||||
.limit(pageSize)
|
||||
.get();
|
||||
|
||||
return {
|
||||
code: 0,
|
||||
msg: 'ok',
|
||||
data: {
|
||||
total: countRes.total,
|
||||
rows: listRes.data
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user