Browse Source

商品模型关联店铺时失效店铺也能被查出来

master
Lemon 5 years ago
parent
commit
8f8b06d059
  1. 4
      app/Service/v3/Implementations/GoodsService.php

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

@ -86,7 +86,9 @@ class GoodsService implements GoodsServiceInterface
public function detail($goodsId)
{
$res = Goods::query()->with('store')->where('id',$goodsId)->first();
$res = Goods::query()->with(['store' => function($query){
$query->withoutGlobalScope('normal');
}])->where('id',$goodsId)->first();
return $res;
}

Loading…
Cancel
Save