'音频', self::TYPE_2 => '视频', ]; protected $appends = ['second']; public function getSrcAttribute() { return isset($this->attributes['src']) ? config('console.pic_path').$this->attributes['src'] : NULL; } public function getPicAttribute() { return isset($this->attributes['pic']) ? config('console.pic_path').$this->attributes['pic'] : NULL; } public function getSecondAttribute() { if (strstr($this->attributes['time'],":")){ $timeArr = explode(':', $this->attributes['time']); return $timeArr[0]*60 + $timeArr[1]; }else{ return $this->attributes['time']; } } }