$value , 'root_id'=>$data['root_id']])->value('type'); return $name; } public function getFileAttr($value) { if (empty($value)) return $value; $ali_oss_bindurl = config('app.ali_oss_bindurl'); $url = 'https://' . $ali_oss_bindurl . '/' . $value; return $url; } public function getVideoImgAttr($value) { if (empty($value)) return $value; $ali_oss_bindurl = config('app.ali_oss_bindurl'); $url = 'https://' . $ali_oss_bindurl . '/' . $value; return $url; } public function trainCourseView(){ return $this->hasMany(TrainCourseView::class, 'con_id', 'id'); } }