Commit 7508214c authored by Hsinli's avatar Hsinli

Merge branch 'master' of t-git.51gjj.com:fangbin/51business

parents 7825df3b dadb10b9
......@@ -39,6 +39,7 @@ class HouseAnalysisController extends Controller {
id: new_house.id,
name: new_house.name,
image: new_house.image,
corner: new_house.corner,
can_gjj_loan: new_house.corner ? 1 : 0,
});
}
......
......@@ -11,8 +11,9 @@ class HouseAnalysisService extends Service {
async getHouseAnalysisByFilter(condition) {
const { ctx } = this;
let { city_code, keyword, page } = condition;
let { city_code, keyword, page, page_size } = condition;
page = page ? page : 1;
page_size = page_size ? page_size : 10;
let where = { status: 'pass' };
if (city_code) {
where.city = city_code;
......@@ -20,7 +21,7 @@ class HouseAnalysisService extends Service {
if (keyword && keyword.length !== 0) {
where.residential = { $like: `%${keyword}%` }
}
const house_analysis_rows = await ctx.realestateModel.HouseAnalysis.list({ page: page, where: where, order: [['id', 'desc']] });
const house_analysis_rows = await ctx.realestateModel.HouseAnalysis.list({ page: page, limit: Number(page_size), where: where, order: [['id', 'desc']] });
const house_analysis = R.project(['id', 'image', 'residential', 'house_type', 'house_area', 'text'])(house_analysis_rows.rows);
return { page: page, count: house_analysis_rows.count, results: house_analysis };
......
......@@ -456,6 +456,7 @@ class NewHouseService extends Service {
name: new_house.name,
image: new_house.image,
corner: new_house.corner,
can_gjj_loan: new_house.corner ? 1 : 0,
});
}
......
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