Browse Source

no message

master
weigang 6 years ago
parent
commit
f221473026
  1. 4
      app/Service/v3/Implementations/CategoryService.php
  2. 4
      app/Service/v3/Implementations/ShopCartService.php

4
app/Service/v3/Implementations/CategoryService.php

@ -37,9 +37,9 @@ class CategoryService implements CategoryServiceInterface
public function allForStore($storeId) public function allForStore($storeId)
{ {
$goodsTypeIds = Goods::query()->select('category_id')
$goodsTypeIds = Goods::query()->select('id','category_id')
->where(['store_id' => $storeId]) ->where(['store_id' => $storeId])
->groupBy(['category_id'])
->groupBy('category_id', 'id')
->get()->toArray(); ->get()->toArray();
return Category::query() return Category::query()

4
app/Service/v3/Implementations/ShopCartService.php

@ -83,8 +83,8 @@ class ShopCartService implements ShopCartServiceInterface
['goods_id','=',$goodsId], ['goods_id','=',$goodsId],
]) ])
->select('num') ->select('num')
->get();
return $ShoppingCart->num;
->first();
return $ShoppingCart->num ?? 0;
} }
public function undo($userId,$marketId) public function undo($userId,$marketId)

Loading…
Cancel
Save