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

house v2 house_analysis page_size fix

parent 3a283885
Pipeline #9395 passed with stage
in 17 seconds
...@@ -11,8 +11,9 @@ class HouseAnalysisService extends Service { ...@@ -11,8 +11,9 @@ class HouseAnalysisService extends Service {
async getHouseAnalysisByFilter(condition) { async getHouseAnalysisByFilter(condition) {
const { ctx } = this; const { ctx } = this;
let { city_code, keyword, page } = condition; let { city_code, keyword, page, page_size } = condition;
page = page ? page : 1; page = page ? page : 1;
page_size = page_size ? page_size : 10;
let where = { status: 'pass' }; let where = { status: 'pass' };
if (city_code) { if (city_code) {
where.city = city_code; where.city = city_code;
...@@ -20,7 +21,7 @@ class HouseAnalysisService extends Service { ...@@ -20,7 +21,7 @@ class HouseAnalysisService extends Service {
if (keyword && keyword.length !== 0) { if (keyword && keyword.length !== 0) {
where.residential = { $like: `%${keyword}%` } 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); 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 }; return { page: page, count: house_analysis_rows.count, results: house_analysis };
......
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