Commit 88c4993b authored by 李尚科's avatar 李尚科
parents fa56abbd 24044d4a
Pipeline #8740 passed with stage
in 3 seconds
......@@ -380,7 +380,7 @@ class NewHouseService extends Service {
type: 1,
key_word: condition.name
};
await ctx.service.house.searchHistory.addSearchHistory(addHistory);
await ctx.service.house.v2.searchHistory.addSearchHistory(addHistory);
filter.where.name = { $like: '%' + condition.name + '%' }
}
if (condition.area_code) {//城市\区域\商圈筛选
......
......@@ -42,10 +42,10 @@ class searchHistoryService extends Service {
//如果没有登录就返回空
return ret;
}
let endDate = moment().subtract(180, 'days').format('YYYY-MM-DD HH:mm:ss');
let endDate = moment().subtract(6, 'months').format('YYYY-MM-DD HH:mm:ss');
let filter = {
page: 1,
limit: 50,
attributes: [[sequelize.literal('distinct `key_word`'), 'key_word']],
where: {
state: 1,
user_id: ctx.userId,
......@@ -55,15 +55,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].keyWord) === -1) {
list.push(searchHistoryList[i].keyWord);
}
}
}
let searchHistoryList = await ctx.realestateModel.SearchHistory.findAll(filter);
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