Authored by 邱骏

update

... ... @@ -151,9 +151,27 @@ const article = {
req.ctx(ArticleModel).getSingleArticle(actId, articleId)
.then(ret => {
let img_arr = _.map(ret, 'img_url');
console.log(img_arr);
let result = {};
let final_result = {};
if (ret.length > 0) {
result.id = ret[0].id;
result.content = ret[0].content;
result.good_count = ret[0].good_count;
result.user_id = ret[0].user_id;
result.user_name = ret[0].user_name;
result.create_time = ret[0].create_time;
result.img_url = img_arr;
}
_.each(result, (value, key) => {
final_result[camelcase(key)] = value;
});
res.json({
code: 200,
data: ret,
data: final_result,
message: GET_ARTICLE_SUCCESS
});
});
... ...