cover_img; return $this->imageUrl($value); } /** * 获取二级分类数组 * id为键,name为值 * @return array */ public static function getCategoryArray($where = [],$options = []) { $model = self::select('id','title') ->where('status',1) ->whereNull('deleted_at'); if(count($where) > 0){ $model->where($where); } $list = $model->get(); $array = empty($options) ? [] : $options; if(count($list) > 0){ foreach ($list as $value) { $array[$value->id] = $value->title; } } return $array; } /** * 处理旧图片 * @param $value * @return string */ public function imageUrl($value) { if(strripos($value,"http") === false){ return env('OSS_IMG_HOST').'/'.$value; }else{ return $value; } } }