修复文章查看数为空保存报错
This commit is contained in:
parent
63638f9588
commit
f2d7f76ab9
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue