|
@@ -24,8 +24,11 @@ class ShopService extends CrudService {
|
|
|
// 收藏
|
|
|
const follow_num = await this.storeShopModel.count({ shop });
|
|
|
// 当前用户是否收藏
|
|
|
- const store_num = await this.storeShopModel.count({ shop, customer });
|
|
|
- const is_follow = store_num > 0;
|
|
|
+ let is_follow = false;
|
|
|
+ if (customer) {
|
|
|
+ const store_num = await this.storeShopModel.count({ shop, customer });
|
|
|
+ is_follow = store_num > 0;
|
|
|
+ }
|
|
|
const res = await this.ctx.service.view.goods.indexGoodsList({ shop }, { skip: 0, limit: 3 });
|
|
|
const obj = { _id: shop, logo, name, market_num, follow_num, is_follow, market: res.list };
|
|
|
arr.push(obj);
|