Authored by 邱骏

改变查询字段

... ... @@ -306,8 +306,8 @@ const activity = {
// 向y100表中插入一条新记录
const y100ArticleId = await req.ctx(ActivityModel).createY100Article(
actId, articleId, imgUrl, numResult[0].total_count + 1, name, tag, style, career, skns, createTime
);
actId, articleId, imgUrl, numResult[0].total_count + 1, name, tag, style, career,
interest, skns, createTime);
return res.json({
code: 200,
... ...
... ... @@ -158,11 +158,12 @@ class AdminModel extends global.yoho.BaseModel {
* @param createTime
* @returns {Promise.<*>}
*/
async createY100Article(actId, articleId, imageUrl, index, name, tag, style, career, skns, createTime) {
async createY100Article(actId, articleId, imageUrl, index, name, tag, style, career, interest, skns, createTime) {
let strSQL = `INSERT INTO ${TB_ACT_ARTICLE_Y100}
(act_id, article_id, img_url, \`index\`, name, tag, style, career, skns, create_time)
(act_id, article_id, img_url, \`index\`, name, tag, style, career, interest, skns, create_time)
VALUES
(:actId, :articleId, :imageUrl, :index, :name, :tag, :style, :career, :skns, :createTime);`;
(:actId, :articleId, :imageUrl, :index, :name, :tag, :style, :career, :interest, :skns,
:createTime);`;
console.log(strSQL, {actId, articleId, imageUrl, index, name, tag, style, career, skns, createTime});
... ... @@ -175,6 +176,7 @@ class AdminModel extends global.yoho.BaseModel {
tag,
style,
career,
interest,
skns,
createTime
});
... ...
... ... @@ -24,9 +24,10 @@ class Y100Model extends global.yoho.BaseModel {
};
let sql = `
SELECT
AA.id,
AAY.id,
AA.good_count,
AA.create_time,
AA.id article_id,
AAY.name,
AAY.img_url,
AAY.career,
... ... @@ -89,9 +90,10 @@ class Y100Model extends global.yoho.BaseModel {
let sql = `
SELECT
AA.id,
AA.id article_id,
AA.good_count,
AA.create_time,
AAY.id,
AAY.name,
AAY.img_url
FROM ${TABLE_ACT_ARTICLE} AA
... ... @@ -127,6 +129,8 @@ class Y100Model extends global.yoho.BaseModel {
INNER JOIN ${TABLE_ACT_ARTICLE} AA ON AAY.article_id = AA.id
where AAY.id = :id`;
console.log(sql, id);
const query = await mysqlCli.query(sql, {
id
});
... ...
... ... @@ -29,6 +29,7 @@ module.exports = {
},
corsAllowOrigin: [
'http://localhost:8081',
'http://localhost:1234',
'http://localhost:63342',
'http://huodong.yoho.cn',
'http://ad.yoho.cn',
... ...