Commit e8c141e7 authored by 李尚科's avatar 李尚科

option v2 fix

parent 07d8fca1
Pipeline #9287 passed with stage
in 4 seconds
...@@ -112,9 +112,9 @@ class OptionService extends Service { ...@@ -112,9 +112,9 @@ class OptionService extends Service {
async getDevelopers(city_code) { async getDevelopers(city_code) {
const { ctx } = this; const { ctx } = this;
const rental_house_developers = await ctx.realestateModel.RentalHouse.findAll({ attributes: ['developer_id'], group: 'developer_id', where: { option_city_code: city_code } }); const rental_house_developers = await ctx.realestateModel.RentalHouse.findAll({ attributes: ['developer_id'], group: 'developer_id', where: { option_city_code: city_code, status: 'online', valid: 1 } });
const developers_ids = rental_house_developers.map(item => { return item.dataValues.developer_id }); const developers_ids = rental_house_developers.map(item => { return item.dataValues.developer_id });
const developers = await ctx.realestateModel.Developer.all({ where: { id: { $in: developers_ids } } }); const developers = await ctx.realestateModel.Developer.all({ where: { id: { $in: developers_ids, status: 'online', valid: 1 } } });
const ret = developers.map(item => { return { id: item.id, name: item.name, image: item.logo, value: item.id } }); const ret = developers.map(item => { return { id: item.id, name: item.name, image: item.logo, value: item.id } });
return ret; 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