|
@@ -16,7 +16,7 @@ class Y100Model extends global.yoho.BaseModel { |
|
@@ -16,7 +16,7 @@ class Y100Model extends global.yoho.BaseModel { |
16
|
* 获取Y100列表
|
16
|
* 获取Y100列表
|
17
|
* @returns {*}
|
17
|
* @returns {*}
|
18
|
*/
|
18
|
*/
|
19
|
- articleY100List({actId, pageNo, pageSize, tag}) {
|
19
|
+ articleY100List({actId, pageNo, pageSize, tag, top}) {
|
20
|
const params = {
|
20
|
const params = {
|
21
|
actId,
|
21
|
actId,
|
22
|
start: (pageNo - 1) * pageSize,
|
22
|
start: (pageNo - 1) * pageSize,
|
|
@@ -28,7 +28,12 @@ class Y100Model extends global.yoho.BaseModel { |
|
@@ -28,7 +28,12 @@ class Y100Model extends global.yoho.BaseModel { |
28
|
AA.good_count,
|
28
|
AA.good_count,
|
29
|
AA.create_time,
|
29
|
AA.create_time,
|
30
|
AAY.name,
|
30
|
AAY.name,
|
31
|
- AAY.img_url
|
31
|
+ AAY.img_url,
|
|
|
32
|
+ AAY.career,
|
|
|
33
|
+ AAY.interest,
|
|
|
34
|
+ AAY.name,
|
|
|
35
|
+ AAY.style,
|
|
|
36
|
+ AAY.tag
|
32
|
FROM ${TABLE_ACT_ARTICLE} AA
|
37
|
FROM ${TABLE_ACT_ARTICLE} AA
|
33
|
INNER JOIN ${TABLE_ACT_ARTICLE_Y100} AAY ON AA.id = AAY.article_id
|
38
|
INNER JOIN ${TABLE_ACT_ARTICLE_Y100} AAY ON AA.id = AAY.article_id
|
34
|
WHERE AA.act_id = :actId`;
|
39
|
WHERE AA.act_id = :actId`;
|
|
@@ -36,12 +41,14 @@ class Y100Model extends global.yoho.BaseModel { |
|
@@ -36,12 +41,14 @@ class Y100Model extends global.yoho.BaseModel { |
36
|
if (tag) {
|
41
|
if (tag) {
|
37
|
sql += ' and AAY.tag like :tag';
|
42
|
sql += ' and AAY.tag like :tag';
|
38
|
params.tag = `%${tag}%`;
|
43
|
params.tag = `%${tag}%`;
|
39
|
- sql += ' ORDER BY AA.good_count DESC';
|
44
|
+
|
|
|
45
|
+ }
|
|
|
46
|
+ if (top) {
|
|
|
47
|
+ sql += ' ORDER BY AAY.top DESC,AA.create_time DESC';
|
40
|
} else {
|
48
|
} else {
|
41
|
- sql += ' and AAY.top = 1';
|
49
|
+ sql += ' ORDER BY AA.good_count DESC';
|
42
|
}
|
50
|
}
|
43
|
sql += ' LIMIT :start, :page';
|
51
|
sql += ' LIMIT :start, :page';
|
44
|
- console.log(sql, actId, pageNo, pageSize, tag);
|
|
|
45
|
|
52
|
|
46
|
return mysqlCli.query(sql, params);
|
53
|
return mysqlCli.query(sql, params);
|
47
|
}
|
54
|
}
|