海南旅游SAAS
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

  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Factories\HasFactory;
  4. /**
  5. * 我的频道
  6. * Class UserChannel
  7. * @package App\Models
  8. */
  9. class UserChannel extends BaseModel
  10. {
  11. use HasFactory;
  12. public function __construct(array $attributes = [])
  13. {
  14. parent::__construct($attributes);
  15. $this->timestamps = false;
  16. }
  17. // 获取时需要转换,写入时框架可自动将数组转换后保存
  18. public function getChannelsAttribute($value)
  19. {
  20. return json_decode($value, true);
  21. }
  22. }