You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
519 B
26 lines
519 B
<?php
|
|
|
|
namespace App\Models;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
/**
|
|
* 我的频道
|
|
* Class UserChannel
|
|
* @package App\Models
|
|
*/
|
|
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);
|
|
}
|
|
}
|