const db = uniCloud.database(); const _ =db.command; module.exports = { _before: function () { // 通用预处理器 }, async getHistoryList(query) { try { let user_id = query.user_id; let data = await db.collection("cms-articles-log") .get(); return { code: 200, data: data } } catch(e) { return { code: 500, msg: e.message } } }, async getHistory(user_id) { try { let count = await db.collection("cms-articles-log").where({ user_id: user_id }).count(); return { code: 200, total: count } } catch(e) { return { code: 500, msg: e.message } } } }