6
0
Fork 0
base
panliang 2023-03-17 22:18:44 +08:00
parent 47afe5b6a8
commit 856515cff9
1 changed files with 2 additions and 2 deletions

View File

@ -68,8 +68,8 @@ class StoreController extends Controller
$spu = $store->productSpus()->with(['specs', 'features'])->findOrFail($id);
$sku = $store->productSkus()
->wherePivot('product_spu_id', $spu->id)
->when($request->filled('sku_id'), fn($q) => $q->wherePivot('product_sku_id', $request->input('sku_id')))
->where('product_spu_id', $spu->id)
->when($request->filled('sku_id'), fn($q) => $q->where('product_sku_id', $request->input('sku_id')))
->first();
if (!$sku) {
throw new BizException('商品sku未上架');