...
|
...
|
@@ -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};`
|
|
|
);
|
|
|
}
|
...
|
...
|
|