...
|
...
|
@@ -93,12 +93,14 @@ class ArticleModel extends global.yoho.BaseModel { |
|
|
* @returns {*}
|
|
|
*/
|
|
|
getSingleArticle(articleId, actId) {
|
|
|
return mysqlCli.query(`select act_article.id,content,good_count,
|
|
|
act_article_img.img_url from ${TABLE_ACT_ARTICLE}
|
|
|
join ${TABLE_ACT_ARTICLE_IMG}
|
|
|
where act_article_img.article_id = act_article.id
|
|
|
and act_article.act_id = :actId
|
|
|
and act_article.id = :articleId;`,
|
|
|
return mysqlCli.query(`SELECT AA.id AS id,AA.content AS content,AA.good_count AS good_count,
|
|
|
DATE_FORMAT(AA.create_time, '%Y-%m-%d %H:%i:%S') AS create_time,
|
|
|
AAI.img_url
|
|
|
FROM ${TABLE_ACT_ARTICLE} AS AA
|
|
|
INNER JOIN ${TABLE_ACT_ARTICLE_IMG} AS AAI
|
|
|
WHERE AAI.article_id = AA.id
|
|
|
AND AA.act_id = :actId
|
|
|
AND AA.id = :articleId;`,
|
|
|
{
|
|
|
actId,
|
|
|
articleId
|
...
|
...
|
|