Commit 5dcc29dd authored by Hsinli's avatar Hsinli

addd

parent e28e32db
Pipeline #12783 passed with stage
in 4 seconds
...@@ -342,30 +342,30 @@ class NewHouseService extends Service { ...@@ -342,30 +342,30 @@ class NewHouseService extends Service {
status: 'online', status: 'online',
valid: 1 valid: 1
}, },
order: [], order: [['sale_type', 'desc']],
} }
//根据筛选项增加不同的指定类型 //根据筛选项增加不同的指定类型
if (condition.hasOwnProperty('type') && condition.type !== '') { // if (condition.hasOwnProperty('type') && condition.type !== '') {
if (type === 'home') { // if (type === 'home') {
//为您推荐只展示50条在售楼盘的数据,根据排序序号取数,数字小的排在前面,数字一样的情况下根据时间逆序排列,时间也一样的情况下随机排列; // //为您推荐只展示50条在售楼盘的数据,根据排序序号取数,数字小的排在前面,数字一样的情况下根据时间逆序排列,时间也一样的情况下随机排列;
filter.limit = Number(condition.page_size) || 50; // filter.limit = Number(condition.page_size) || 50;
// filter.order.push(['order_id', 'desc'], ['created_at', 'desc']);拿掉排序,跟默认排序重复了 2019-6-28 14:06:00 lisk // // filter.order.push(['order_id', 'desc'], ['created_at', 'desc']);拿掉排序,跟默认排序重复了 2019-6-28 14:06:00 lisk
} else if (type === 'all') { // } else if (type === 'all') {
filter.order.push(['sale_type', 'desc']); // filter.order.push(['sale_type', 'desc']);
} else if (type === 'sale') { // } else if (type === 'sale') {
//点击在售楼盘进入列表页面且只展示当前销售状态为在售的楼盘 // //点击在售楼盘进入列表页面且只展示当前销售状态为在售的楼盘
filter.where.sale_type = 3; // filter.where.sale_type = 3;
} else if (type === 'open') { // } else if (type === 'open') {
//只展示最近三个月内开盘的楼盘,往前追溯三个月,列表单次加载30条楼盘数据,滑到底部再次加载30条 // //只展示最近三个月内开盘的楼盘,往前追溯三个月,列表单次加载30条楼盘数据,滑到底部再次加载30条
let endDate = moment().subtract(180, 'days').format('YYYY-MM-DD HH:mm:ss'); // let endDate = moment().subtract(180, 'days').format('YYYY-MM-DD HH:mm:ss');
filter.where.open_date = { $gt: endDate }; // filter.where.open_date = { $gt: endDate };
filter.order.push(['sale_type', 'desc']); // filter.order.push(['sale_type', 'desc']);
} else if (type === 'favourable') { // } else if (type === 'favourable') {
//点击优惠好盘只展示有优惠的楼盘,列表单次加载30条楼盘数据,滑到底部再次加载30条 // //点击优惠好盘只展示有优惠的楼盘,列表单次加载30条楼盘数据,滑到底部再次加载30条
filter.where.favourable_info = { $not: null }; // filter.where.favourable_info = { $not: null };
filter.order.push(['sale_type', 'desc']); // filter.order.push(['sale_type', 'desc']);
} // }
} // }
//是否有值来增加筛选项 //是否有值来增加筛选项
if (condition.unit_price && condition.unit_price.hasOwnProperty('min') && condition.unit_price.hasOwnProperty('max')) {//单价 if (condition.unit_price && condition.unit_price.hasOwnProperty('min') && condition.unit_price.hasOwnProperty('max')) {//单价
......
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