Commit 3fab101e authored by Hsinli's avatar Hsinli

addd

parent 7e6bb087
Pipeline #8746 passed with stage
in 9 seconds
...@@ -51,16 +51,20 @@ class searchHistoryService extends Service { ...@@ -51,16 +51,20 @@ class searchHistoryService extends Service {
user_id: ctx.userId, user_id: ctx.userId,
created_at: { $gt: endDate } created_at: { $gt: endDate }
}, },
group: 'key_word',
order: [['created_at', 'desc']], order: [['created_at', 'desc']],
} }
if (type) { if (type) {
filter.where.house_style = type; filter.where.house_style = type;
} }
let searchHistoryList = await ctx.realestateModel.SearchHistory.findAll(filter); let searchHistoryList = await ctx.realestateModel.SearchHistory.findAll(filter);
let list = searchHistoryList.map(v => { return v.key_word }); if (searchHistoryList.length > 0) {
for (let i in searchHistoryList) {
if (list.indexOf(searchHistoryList[i].key_word) === -1) {
list.push(searchHistoryList[i].key_word);
}
}
}
ctx.logger.info(list); ctx.logger.info(list);
ret = { ret = {
results: list, results: list,
count: list.length count: list.length
......
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