fixed customer guard https://guangdagit.com/beike/beikeshop/issues/195
This commit is contained in:
parent
fbb35e59be
commit
106471ea2e
|
|
@ -56,7 +56,9 @@ class Product extends Base
|
|||
|
||||
public function inCurrentWishlist()
|
||||
{
|
||||
return $this->hasOne(CustomerWishlist::class)->where('customer_id', current_customer() ? current_customer()->id : 0);
|
||||
$customer = current_customer();
|
||||
$customerId = $customer ? $customer->id : 0;
|
||||
return $this->hasOne(CustomerWishlist::class)->where('customer_id', $customerId);
|
||||
}
|
||||
|
||||
public function getUrlAttribute()
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ class ShopServiceProvider extends ServiceProvider
|
|||
$this->loadRoutesFrom(__DIR__ . '/../Routes/shop.php');
|
||||
|
||||
load_settings();
|
||||
$this->registerGuard();
|
||||
|
||||
if (Str::startsWith($uri, '/admin')) {
|
||||
return;
|
||||
|
|
@ -50,7 +51,6 @@ class ShopServiceProvider extends ServiceProvider
|
|||
]);
|
||||
|
||||
$this->mergeConfigFrom(__DIR__ . '/../../Config/beike.php', 'beike');
|
||||
$this->registerGuard();
|
||||
$this->loadThemeViewPath();
|
||||
$this->loadComponents();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue