diff --git a/beike/Admin/Repositories/PageRepo.php b/beike/Admin/Repositories/PageRepo.php index 2f0ed732..5675c935 100644 --- a/beike/Admin/Repositories/PageRepo.php +++ b/beike/Admin/Repositories/PageRepo.php @@ -71,10 +71,10 @@ class PageRepo } $page->fill([ 'page_category_id' => (int) ($data['page_category_id'] ?? 0), - 'position' => $data['position'] ?? 0, - 'active' => $data['active'] ?? true, - 'author' => $data['author'] ?? true, - 'views' => $data['views'] ?? 0, + 'position' => (int) ($data['position'] ?? 0), + 'active' => (bool) ($data['active'] ?? true), + 'author' => (bool) ($data['author'] ?? true), + 'views' => (int) ($data['views'] ?? 0), ]); $page->saveOrFail(); diff --git a/beike/Plugin/Plugin.php b/beike/Plugin/Plugin.php index 6f656fbb..d922cd62 100644 --- a/beike/Plugin/Plugin.php +++ b/beike/Plugin/Plugin.php @@ -155,6 +155,7 @@ class Plugin implements Arrayable, \ArrayAccess public function getLocaleName(): string { $currentLocale = locale(); + return is_array($this->name) ? ($this->name[$currentLocale] ?? '') : (string) $this->name; } @@ -166,6 +167,7 @@ class Plugin implements Arrayable, \ArrayAccess public function getLocaleDescription(): string { $currentLocale = locale(); + return is_array($this->description) ? ($this->description[$currentLocale] ?? '') : (string) $this->description; } diff --git a/beike/Shop/Services/TotalServices/CustomerDiscountService.php b/beike/Shop/Services/TotalServices/CustomerDiscountService.php index 4847032d..27d95666 100644 --- a/beike/Shop/Services/TotalServices/CustomerDiscountService.php +++ b/beike/Shop/Services/TotalServices/CustomerDiscountService.php @@ -22,7 +22,7 @@ class CustomerDiscountService public static function getTotal(CheckoutService $checkout) { $totalService = $checkout->totalService; - $customer = current_customer(); + $customer = current_customer(); if (empty($customer)) { return null; }