'array', ]; public static $_coverType = [1=>'图片', 2=>'视频']; public static $_pathType = ['page'=>'page','webview'=>'webview','applet'=>'applet']; public static $_type = [1=>'首页']; public static $_status = ['禁用', '正常']; public function getCoverUrlAttribute($value) { $value = $value ? $value : $this->cover; return $this->imageUrl($value); } public function getCoverTypeTextAttribute($value) { $value = $value ? $value : $this->cover_type; return isset(self::$_coverType[$value]) ? self::$_coverType[$value] : ''; } public function getPathTypeTextAttribute($value) { $value = $value ? $value : $this->path_type; return isset(self::$_pathType[$value]) ? self::$_pathType[$value] : ''; } public function getTypeTextAttribute($value) { $value = $value ? $value : $this->type; return isset(self::$_type[$value]) ? self::$_type[$value] : ''; } public function getStatusTextAttribute($value) { $value = $value ? $value : $this->stauts; return isset(self::$_status[$value]) ? self::$_status[$value] : ''; } /** * 处理旧图片 * @param $value * @return string */ public function imageUrl($value) { if(strripos($value,"http") === false){ return config('filesystems.disks.oss.img_host').'/'.$value; }else{ return $value; } } }