This commit is contained in:
TL 2022-08-11 15:27:34 +08:00
parent 32dfe47037
commit 8b8fe1730d
1 changed files with 1 additions and 1 deletions

View File

@ -138,7 +138,7 @@ class CustomerRepo
$customer = Customer::query()->findOrFail($customer); $customer = Customer::query()->findOrFail($customer);
} }
if (!CustomerWishlist::query()->where('customer_id', $customer->id)->where('product_id', $productId)->first()) { if (!$customer->wishlists()->where('product_id', $productId)->first()) {
$customer->wishlists()->save(new CustomerWishlist(['product_id' => $productId])); $customer->wishlists()->save(new CustomerWishlist(['product_id' => $productId]));
} }