Showing
5 changed files
with
16 additions
and
9 deletions
@@ -306,8 +306,8 @@ const activity = { | @@ -306,8 +306,8 @@ const activity = { | ||
306 | 306 | ||
307 | // 向y100表中插入一条新记录 | 307 | // 向y100表中插入一条新记录 |
308 | const y100ArticleId = await req.ctx(ActivityModel).createY100Article( | 308 | const y100ArticleId = await req.ctx(ActivityModel).createY100Article( |
309 | - actId, articleId, imgUrl, numResult[0].total_count + 1, name, tag, style, career, skns, createTime | ||
310 | - ); | 309 | + actId, articleId, imgUrl, numResult[0].total_count + 1, name, tag, style, career, |
310 | + interest, skns, createTime); | ||
311 | 311 | ||
312 | return res.json({ | 312 | return res.json({ |
313 | code: 200, | 313 | code: 200, |
@@ -158,11 +158,12 @@ class AdminModel extends global.yoho.BaseModel { | @@ -158,11 +158,12 @@ class AdminModel extends global.yoho.BaseModel { | ||
158 | * @param createTime | 158 | * @param createTime |
159 | * @returns {Promise.<*>} | 159 | * @returns {Promise.<*>} |
160 | */ | 160 | */ |
161 | - async createY100Article(actId, articleId, imageUrl, index, name, tag, style, career, skns, createTime) { | 161 | + async createY100Article(actId, articleId, imageUrl, index, name, tag, style, career, interest, skns, createTime) { |
162 | let strSQL = `INSERT INTO ${TB_ACT_ARTICLE_Y100} | 162 | let strSQL = `INSERT INTO ${TB_ACT_ARTICLE_Y100} |
163 | - (act_id, article_id, img_url, \`index\`, name, tag, style, career, skns, create_time) | 163 | + (act_id, article_id, img_url, \`index\`, name, tag, style, career, interest, skns, create_time) |
164 | VALUES | 164 | VALUES |
165 | - (:actId, :articleId, :imageUrl, :index, :name, :tag, :style, :career, :skns, :createTime);`; | 165 | + (:actId, :articleId, :imageUrl, :index, :name, :tag, :style, :career, :interest, :skns, |
166 | + :createTime);`; | ||
166 | 167 | ||
167 | console.log(strSQL, {actId, articleId, imageUrl, index, name, tag, style, career, skns, createTime}); | 168 | console.log(strSQL, {actId, articleId, imageUrl, index, name, tag, style, career, skns, createTime}); |
168 | 169 | ||
@@ -175,6 +176,7 @@ class AdminModel extends global.yoho.BaseModel { | @@ -175,6 +176,7 @@ class AdminModel extends global.yoho.BaseModel { | ||
175 | tag, | 176 | tag, |
176 | style, | 177 | style, |
177 | career, | 178 | career, |
179 | + interest, | ||
178 | skns, | 180 | skns, |
179 | createTime | 181 | createTime |
180 | }); | 182 | }); |
@@ -605,7 +605,7 @@ const article = { | @@ -605,7 +605,7 @@ const article = { | ||
605 | like(req, res, next) { | 605 | like(req, res, next) { |
606 | const actId = req.body.actId; | 606 | const actId = req.body.actId; |
607 | const articleId = req.body.articleId; | 607 | const articleId = req.body.articleId; |
608 | - | 608 | + |
609 | let vote = function() { | 609 | let vote = function() { |
610 | req.ctx(ArticleModel).likeArticle(actId, articleId) | 610 | req.ctx(ArticleModel).likeArticle(actId, articleId) |
611 | .then(() => { | 611 | .then(() => { |
@@ -24,9 +24,10 @@ class Y100Model extends global.yoho.BaseModel { | @@ -24,9 +24,10 @@ class Y100Model extends global.yoho.BaseModel { | ||
24 | }; | 24 | }; |
25 | let sql = ` | 25 | let sql = ` |
26 | SELECT | 26 | SELECT |
27 | - AA.id, | 27 | + AAY.id, |
28 | AA.good_count, | 28 | AA.good_count, |
29 | AA.create_time, | 29 | AA.create_time, |
30 | + AA.id article_id, | ||
30 | AAY.name, | 31 | AAY.name, |
31 | AAY.img_url, | 32 | AAY.img_url, |
32 | AAY.career, | 33 | AAY.career, |
@@ -89,9 +90,10 @@ class Y100Model extends global.yoho.BaseModel { | @@ -89,9 +90,10 @@ class Y100Model extends global.yoho.BaseModel { | ||
89 | 90 | ||
90 | let sql = ` | 91 | let sql = ` |
91 | SELECT | 92 | SELECT |
92 | - AA.id, | 93 | + AA.id article_id, |
93 | AA.good_count, | 94 | AA.good_count, |
94 | AA.create_time, | 95 | AA.create_time, |
96 | + AAY.id, | ||
95 | AAY.name, | 97 | AAY.name, |
96 | AAY.img_url | 98 | AAY.img_url |
97 | FROM ${TABLE_ACT_ARTICLE} AA | 99 | FROM ${TABLE_ACT_ARTICLE} AA |
@@ -127,6 +129,8 @@ class Y100Model extends global.yoho.BaseModel { | @@ -127,6 +129,8 @@ class Y100Model extends global.yoho.BaseModel { | ||
127 | INNER JOIN ${TABLE_ACT_ARTICLE} AA ON AAY.article_id = AA.id | 129 | INNER JOIN ${TABLE_ACT_ARTICLE} AA ON AAY.article_id = AA.id |
128 | where AAY.id = :id`; | 130 | where AAY.id = :id`; |
129 | 131 | ||
132 | + console.log(sql, id); | ||
133 | + | ||
130 | const query = await mysqlCli.query(sql, { | 134 | const query = await mysqlCli.query(sql, { |
131 | id | 135 | id |
132 | }); | 136 | }); |
@@ -29,6 +29,7 @@ module.exports = { | @@ -29,6 +29,7 @@ module.exports = { | ||
29 | }, | 29 | }, |
30 | corsAllowOrigin: [ | 30 | corsAllowOrigin: [ |
31 | 'http://localhost:8081', | 31 | 'http://localhost:8081', |
32 | + 'http://localhost:1234', | ||
32 | 'http://localhost:63342', | 33 | 'http://localhost:63342', |
33 | 'http://huodong.yoho.cn', | 34 | 'http://huodong.yoho.cn', |
34 | 'http://ad.yoho.cn', | 35 | 'http://ad.yoho.cn', |
@@ -45,7 +46,7 @@ module.exports = { | @@ -45,7 +46,7 @@ module.exports = { | ||
45 | interfaceShunt: { | 46 | interfaceShunt: { |
46 | open: false | 47 | open: false |
47 | }, | 48 | }, |
48 | - loggers: { | 49 | + loggers: { |
49 | infoFile: { | 50 | infoFile: { |
50 | name: 'info', | 51 | name: 'info', |
51 | level: 'info', | 52 | level: 'info', |
-
Please register or login to post a comment