瀏覽代碼

lottery done

StephenArk30 5 年之前
父節點
當前提交
eb1ca2653c
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      src/api/controller/goods.js

+ 5 - 0
src/api/controller/goods.js

@@ -46,6 +46,10 @@ module.exports = class extends Base {
     const brand = await this.model('brand').where({id: info.brand_id}).find();
     const commentCount = await this.model('comment').where({value_id: goodsId, type_id: 0}).count();
     const hotComment = await this.model('comment').where({value_id: goodsId, type_id: 0}).find();
+    let activity = null;
+    if (info.activity_id > 0) {
+      activity = await this.model('activity').where({id: info.activity_id}).find();
+    }
     let commentInfo = {};
     if (!think.isEmpty(hotComment)) {
       const commentUser = await this.model('user').field(['nicNkame', 'name', 'avatar_url']).where({id: hotComment.user_id}).find();
@@ -72,6 +76,7 @@ module.exports = class extends Base {
     // return this.json(jsonData);
     return this.success({
       info: info,
+      activity: activity,
       gallery: gallery,
       attribute: attribute,
       userHasCollect: userHasCollect,