diff --git a/pages/index/index.vue b/pages/index/index.vue index 1a82e44..1b0c95c 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -9,7 +9,7 @@ @@ -87,7 +87,7 @@ -
查看更多
+
diff --git a/uniCloud-aliyun/cloudfunctions/router/service/client/enquiry/sheet/pub/getList.js b/uniCloud-aliyun/cloudfunctions/router/service/client/enquiry/sheet/pub/getList.js index 7aa1436..9a73721 100644 --- a/uniCloud-aliyun/cloudfunctions/router/service/client/enquiry/sheet/pub/getList.js +++ b/uniCloud-aliyun/cloudfunctions/router/service/client/enquiry/sheet/pub/getList.js @@ -59,15 +59,23 @@ module.exports = { const rows = res.rows rows.forEach((row, rowIndex) => { row.productList.forEach(async (product, productIndex) => { - const template = await vk.baseDao.findById({ + rows[rowIndex].productList[productIndex].template = await vk.baseDao.findById({ dbName, data: { id: product.goodsId } }); - rows[rowIndex].productList[productIndex].template = template }) }) + for (const item of res.rows) { + const index = res.rows.indexOf(item); + res.rows[index].quoteNum = await vk.baseDao.count({ + dbName: 'jjx-enquiry-quote', + whereJson:{ + sheetId: item._id + } + }) + } res.rows = rows // 业务逻辑结束----------------------------------------------------------- return res; diff --git a/uniCloud-aliyun/cloudfunctions/router/service/client/process/quote/kh/add.js b/uniCloud-aliyun/cloudfunctions/router/service/client/process/quote/kh/add.js index f298aca..9c329c9 100644 --- a/uniCloud-aliyun/cloudfunctions/router/service/client/process/quote/kh/add.js +++ b/uniCloud-aliyun/cloudfunctions/router/service/client/process/quote/kh/add.js @@ -45,7 +45,7 @@ module.exports = { }; // 业务逻辑开始----------------------------------------------------------- res.id = await vk.baseDao.add({ - dbName, + dbName: '', dataJson:{ title, address, diff --git a/uniCloud-aliyun/cloudfunctions/router/service/client/process/sheet/pub/getList.js b/uniCloud-aliyun/cloudfunctions/router/service/client/process/sheet/pub/getList.js index fcdc75f..113a28c 100644 --- a/uniCloud-aliyun/cloudfunctions/router/service/client/process/sheet/pub/getList.js +++ b/uniCloud-aliyun/cloudfunctions/router/service/client/process/sheet/pub/getList.js @@ -36,6 +36,7 @@ module.exports = { pageIndex, pageSize, whereJson, + sortArr:[{ name:"_add_time", type:"desc" }], foreignDB: [ { dbName: "uni-id-users", @@ -58,6 +59,15 @@ module.exports = { ] }); + for (const item of res.rows) { + const index = res.rows.indexOf(item); + res.rows[index].quoteNum = await vk.baseDao.count({ + dbName: 'jjx-process-quote', + whereJson:{ + sheetId: item._id + } + }) + } // 业务逻辑结束----------------------------------------------------------- return res; diff --git a/uniCloud-aliyun/cloudfunctions/router/service/client/spot/goods/kh/getSelfOne.js b/uniCloud-aliyun/cloudfunctions/router/service/client/spot/goods/kh/getSelfOne.js index cddafee..0705bcd 100644 --- a/uniCloud-aliyun/cloudfunctions/router/service/client/spot/goods/kh/getSelfOne.js +++ b/uniCloud-aliyun/cloudfunctions/router/service/client/spot/goods/kh/getSelfOne.js @@ -1,28 +1,28 @@ 'use strict'; const dbName = 'jjx-spot-goods' module.exports = { - /** - * XXXnameXXX - * @url client/spot/goods/kh/getSelfOne 前端调用的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 } = data; - let res = { code: 0, msg: "" }; - // 业务逻辑开始----------------------------------------------------------- - res.data = await vk.baseDao.findByWhereJson({ - dbName, - whereJson:{ - user_id: uid, - } - }); + /** + * XXXnameXXX + * @url client/spot/goods/kh/getSelfOne 前端调用的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} = data; + let res = {code: 0, msg: ""}; + // 业务逻辑开始----------------------------------------------------------- + res = await vk.baseDao.select({ + dbName, + whereJson: { + userId: uid, + }, + limit: 1 + }); - - // 业务逻辑结束----------------------------------------------------------- - return res; - } + // 业务逻辑结束----------------------------------------------------------- + return res; + } }