lrf 2 năm trước cách đây
mục cha
commit
1b98f351bc
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      app/service/view/goods.js

+ 2 - 1
app/service/view/goods.js

@@ -81,7 +81,8 @@ class GoodsService extends CrudService {
     if (parseInt(limit)) pipline.push({ $limit: parseInt(limit) });
     pipline.push({ $sort: { createdAt: -1 } });
     const list = await this.goodsModel.aggregate(pipline);
-    return list;
+    const total = await this.goodsModel.count();
+    return { list, total };
   }
 
   async indexActTagsGoods() {