Commit a36d3d52 authored by Hsinli's avatar Hsinli

addd

parent 879f66b0
Pipeline #8734 passed with stage
in 13 seconds
......@@ -46,6 +46,7 @@ class searchHistoryService extends Service {
let filter = {
page: 1,
limit: 50,
attributes: [[sequelize.literal('distinct `key_word`'), 'key_word']],
where: {
state: 1,
user_id: ctx.userId,
......@@ -55,15 +56,9 @@ class searchHistoryService extends Service {
if (type) {
filter.where.house_style = type;
}
let list = [];
let searchHistoryList = await ctx.realestateModel.SearchHistory.all(filter);
if (searchHistoryList.length > 0) {
for (let i in searchHistoryList) {
if (list.indexOf(searchHistoryList[i].key_word) === -1) {
list.push(searchHistoryList[i].key_word);
}
}
}
let list = searchHistoryList.map(v => { return v.key_word });
ctx.logger.info(list);
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