Commit 20d975ea authored by Hsinli's avatar Hsinli

addd

parent c2c15585
Pipeline #8870 passed with stage
in 4 seconds
......@@ -12,7 +12,7 @@ class AnswerController extends Controller {
let inputParams = ctx.request.body;
const rule = {
answer: { type: 'string', required: true },
id: { type: 'integer', required: true },
question_id: { type: 'integer', required: true },
city_code: { type: 'string', required: true },
};
ctx.validate(rule, inputParams);
......
......@@ -68,7 +68,7 @@ module.exports = app => {
AnswerLike.one = async (data) => {
const attributes = data.attributes ? data.attributes : {};
const where = data.where ? data.where : {};
return await SearchHistory.findOne({
return await AnswerLike.findOne({
attributes: attributes,
where: where,
});
......
......@@ -72,7 +72,7 @@ module.exports = app => {
HotQuestionAnswer.one = async (data) => {
const attributes = data.attributes ? data.attributes : {};
const where = data.where ? data.where : {};
return await SearchHistory.findOne({
return await HotQuestionAnswer.findOne({
attributes: attributes,
where: where,
});
......
......@@ -68,7 +68,7 @@ module.exports = app => {
HotQuestionPut.one = async (data) => {
const attributes = data.attributes ? data.attributes : {};
const where = data.where ? data.where : {};
return await SearchHistory.findOne({
return await HotQuestionPut.findOne({
attributes: attributes,
where: where,
});
......
......@@ -19,7 +19,7 @@ class HotQuestionAnswerService extends Service {
app_type_id: ctx.appTypeId,
question_id: inputParams.question_id,
answer: inputParams.answer,
city: inputParams.city,
city: inputParams.city_code,
status: 'wait',
};
let retId = await ctx.realestateModel.HotQuestionAnswer.add(data);
......@@ -36,7 +36,7 @@ class HotQuestionAnswerService extends Service {
page: condition.page || 1,
limit: condition.limit || 10,
where: {
question_id: Number(condition.id),
question_id: Number(condition.question_id),
status: 'pass',
},
order: [['created_at', 'desc']]
......@@ -46,7 +46,7 @@ class HotQuestionAnswerService extends Service {
for (let i in res) {
taskList[i] = this.formatAnswer(res[i]);
}
retList = await Promise.all(taskList).then(result => {
let retList = await Promise.all(taskList).then(result => {
return result;
}).catch(error => {
ctx.failed(error);
......
......@@ -73,7 +73,7 @@ class HotQuestionPutService extends Service {
limit: Number(condition.limit) || 10,
question_id: Number(condition.id),
}
let answerLsit = await ctx.service.house.v2.HotQuestionAnswer.answerList(answerFliter);
let answerLsit = await ctx.service.house.v2.hotQuestionAnswer.answerList(answerFliter);
let ret = {
question: question.question,
answerList: answerLsit
......
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