...
|
...
|
@@ -16,7 +16,7 @@ class Y100Model extends global.yoho.BaseModel { |
|
|
* 获取Y100列表
|
|
|
* @returns {*}
|
|
|
*/
|
|
|
articleY100List({actId, pageNo, pageSize, tag}) {
|
|
|
articleY100List({actId, pageNo, pageSize, tag, top}) {
|
|
|
const params = {
|
|
|
actId,
|
|
|
start: (pageNo - 1) * pageSize,
|
...
|
...
|
@@ -28,7 +28,12 @@ class Y100Model extends global.yoho.BaseModel { |
|
|
AA.good_count,
|
|
|
AA.create_time,
|
|
|
AAY.name,
|
|
|
AAY.img_url
|
|
|
AAY.img_url,
|
|
|
AAY.career,
|
|
|
AAY.interest,
|
|
|
AAY.name,
|
|
|
AAY.style,
|
|
|
AAY.tag
|
|
|
FROM ${TABLE_ACT_ARTICLE} AA
|
|
|
INNER JOIN ${TABLE_ACT_ARTICLE_Y100} AAY ON AA.id = AAY.article_id
|
|
|
WHERE AA.act_id = :actId`;
|
...
|
...
|
@@ -36,12 +41,14 @@ class Y100Model extends global.yoho.BaseModel { |
|
|
if (tag) {
|
|
|
sql += ' and AAY.tag like :tag';
|
|
|
params.tag = `%${tag}%`;
|
|
|
sql += ' ORDER BY AA.good_count DESC';
|
|
|
|
|
|
}
|
|
|
if (top) {
|
|
|
sql += ' ORDER BY AAY.top DESC,AA.create_time DESC';
|
|
|
} else {
|
|
|
sql += ' and AAY.top = 1';
|
|
|
sql += ' ORDER BY AA.good_count DESC';
|
|
|
}
|
|
|
sql += ' LIMIT :start, :page';
|
|
|
console.log(sql, actId, pageNo, pageSize, tag);
|
|
|
|
|
|
return mysqlCli.query(sql, params);
|
|
|
}
|
...
|
...
|
|