소스 검색

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,