Browse Source

增加$this->timestamps = false;不自动处理时间戳

dev
李可松 4 years ago
parent
commit
00e2371914
  1. 8
      app/Models/UserChannel.php

8
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);

Loading…
Cancel
Save