From 00e23719144aa43c1f5833dff4227ae9d6103498 Mon Sep 17 00:00:00 2001 From: liapples Date: Mon, 26 Jul 2021 18:33:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0$this->timestamps=20=3D=20fal?= =?UTF-8?q?se;=E4=B8=8D=E8=87=AA=E5=8A=A8=E5=A4=84=E7=90=86=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E6=88=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/UserChannel.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Models/UserChannel.php b/app/Models/UserChannel.php index 776c80d..764021c 100644 --- a/app/Models/UserChannel.php +++ b/app/Models/UserChannel.php @@ -12,7 +12,13 @@ class UserChannel extends BaseModel { use HasFactory; - // 获取时需要转换,写入时框架可自动将数组转换后保存 + public function __construct(array $attributes = []) + { + parent::__construct($attributes); + $this->timestamps = false; + } + + // 获取时需要转换,写入时框架可自动将数组转换后保存 public function getChannelsAttribute($value) { return json_decode($value, true);