1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
| 'use strict';
| module.exports = {
| /**
| * 用户收藏课程列表
| * @url client/course/pub/my_course_collection 前端调用的url参数地址
| * data 请求参数
| * @param {String} params1 参数1
| */
| main: async (event) => {
| let { data = {}, userInfo, util, filterResponse, originalParam } = event;
| let { customUtil, uniID, config, pubFun, vk, db, _ } = util;
| let { uid, pageIndex = 1, pageSize = 10 } = data;
| let res = { code: 0, msg: "" };
| // 业务逻辑开始-----------------------------------------------------------
| res = await vk.baseDao.selects({
| dbName: "user-star",
| getMain: false, // 是否只返回rows数据
| pageIndex: pageIndex,
| pageSize: pageSize,
| foreignDB: [{
| dbName: "course",
| localKey: "course_id",
| foreignKey: "_id",
| as: "detail",
| limit: 1,
| foreignDB: [{
| dbName: "course_videos",
| localKey: "_id",
| foreignKey: "course_id",
| as: "videos",
| fieldJson: { render_desc: false }
| }]
| }],
| sortArr: [{ "name": "_add_time", "type": "desc" }],
| whereJson: {
| user_id: uid
| },
| });
| // 业务逻辑结束-----------------------------------------------------------
| return res;
| }
| }
|
|