Commit bcf7a71c authored by Hsinli's avatar Hsinli

addd

parent 7581526d
Pipeline #5937 passed with stage
in 10 seconds
......@@ -170,6 +170,44 @@ class CollectionService extends Service {
}
/**
* 给我的页面使用 只需要count
*/
async getCollectionCount() {
const { ctx, service } = this;
if (!ctx.userId) {
return { count: 0 };
}
let endDate = moment().subtract(180, 'days').format('YYYY-MM-DD HH:mm:ss');
let filter = {
pageIndex: 1,
pageSize: 50,
queryConditions: [{
key: "state",
value: 1,
operator: "equal"
}, {
key: "userId",
value: ctx.userId,
operator: "equal"
}, {
key: "createdAt",
value: endDate,
operator: "greater"
},
],
orderConditions: [{
key: 'createdAt',
orderSequence: 'desc',
},],
}
let collectionList = await service.houseCommon.collection.all(filter);
let ret = {
count: collectionList.rowCount
};
return ret;
}
}
module.exports = CollectionService;
......@@ -109,6 +109,41 @@ class FootPrintService extends Service {
}
/**
* 我的-获取用户足迹个数
*/
async getFootPrintCount() {
const { ctx, service } = this;
if (!ctx.userId) {
return { count: 0 };
}
const filter = {
pageIndex: 1,
pageSize: 50,
queryConditions: [{
key: "state",
value: 1,
operator: "equal"
}, {
key: "userId",
value: ctx.userId,
operator: "equal"
},
],
orderConditions: [{
key: 'createdAt',
orderSequence: 'desc',
},],
}
const foot_prints_results = await service.houseCommon.footPrint.all(filter);
let ret = {
count: foot_prints_results.rowCount
};
return ret;
}
}
module.exports = FootPrintService;
......@@ -34,9 +34,9 @@ class MineService extends Service {
return ret;
}
let appUserInfo = await this.getAppUserInfo();
let footPrintList = await service.house.footPrint.getFootPrintList();
let collectionList = await service.house.collection.getCollectionList();
let orderList = await service.house.order.getOrderList();
let footPrintList = await service.house.footPrint.getFootPrintCount();
let collectionList = await service.house.collection.getCollectionCount();
let orderList = await service.house.order.getOrderCount();
let phone = appUserInfo.phone || '';
if (phone.length > 0) {
......
......@@ -60,6 +60,12 @@ class OrderService extends Service {
*/
async getOrderList() {
const { ctx, service } = this;
if (!ctx.userId) {
return {
results: [],
rowCount: 0
};
}
let endDate = moment().subtract(180, 'days').format('YYYY-MM-DD HH:mm:ss');
let filter = {
pageIndex: 1,
......@@ -126,6 +132,45 @@ class OrderService extends Service {
return ret;
}
/**
* 我的-获取预约个数
*/
async getOrderCount() {
const { ctx, service } = this;
if (!ctx.userId) {
return { count: 0 };
}
let endDate = moment().subtract(180, 'days').format('YYYY-MM-DD HH:mm:ss');
let filter = {
pageIndex: 1,
pageSize: 50,
queryConditions: [{
key: "state",
value: 1,
operator: "equal"
}, {
key: "userId",
value: ctx.userId,
operator: "equal"
}, {
key: "createdAt",
value: endDate,
operator: "greater"
},
],
orderConditions: [{
key: 'createdAt',
orderSequence: 'desc',
},],
}
let orderList = await service.houseCommon.order.all(filter);
let ret = {
count: orderList.rowCount
};
return ret;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment