belongsTo(VrGroup::class, 'vr_group_id'); } /** * 拼接 */ public function getPicPathAttr($value) { if (empty($value)) return $value; $ali_oss_bindurl = config('app.vr_ali_oss_bindurl'); $url = 'https://' . $ali_oss_bindurl . '/' . $value; return $url; } /** * 处理 */ public function setPicPathAttr($value){ $ali_oss_bindurl = config('app.vr_ali_oss_bindurl'); $url = 'https://' . $ali_oss_bindurl . '/'; return str_replace($url, '', $value); } /** * 拼接 */ // public function getVrPathAttr($value) // { // if (empty($value)) return $value; // // $ali_oss_bindurl = config('app.ali_oss_bindurl'); // $ali_oss_bindurl = 'vr.oss.xueque.net/'; // $url = 'https://' . $ali_oss_bindurl . $value; // return $url; // } /** * 处理 */ public function setVrPathAttr($value){ $ali_oss_bindurl = config('app.vr_ali_oss_bindurl'); $url = 'https://' . $ali_oss_bindurl . '/'; return str_replace($url, '', $value); } /** * 关联视图 */ public function hotspot() { return $this->hasMany(VrHotspot::class, 'view_id'); } }