Authored by 李奇

列表页返回添加用户昵称

... ... @@ -7,6 +7,7 @@
const _ = require('lodash');
const mysqlCli = global.yoho.utils.mysqlCli;
const TABLE_USER = 'user';
const TABLE_ACT_ARTICLE = 'act_article';
const TABLE_ACT_ARTICLE_IMG = 'act_article_img';
... ... @@ -41,10 +42,12 @@ class ArticleModel extends global.yoho.BaseModel {
AA.good_count,
AAI.img_url,
AA.content,
AA.create_time
FROM ${TABLE_ACT_ARTICLE} AS AA
INNER JOIN ${TABLE_ACT_ARTICLE_IMG} AS AAI
ON AA.id = AAI.article_id
AA.create_time,
USR.user_name
FROM ${TABLE_ACT_ARTICLE} AA
INNER JOIN ${TABLE_ACT_ARTICLE_IMG} AAI
INNER JOIN ${TABLE_USER} USR
ON AA.id = AAI.article_id AND AA.user_id = USR.id
${whereSql} ${orderSql} ${limitSql};`
);
}
... ...
... ... @@ -51,6 +51,10 @@ const userController = {
req.ctx(UserModel).createUser(userInfo)
.then((id) => {
// 用户ID
_.set(req.session, 'user.id', id);
res.json({
code: 200,
data: _.assign(userInfo, {id}),
... ...