belongsTo('user', 'uid')->bind(['headimgurl']); } public function employee(){ return $this->hasOne('employee','uid','uid')->bind(['name', 'org_id']); } public function getEnclosureFileAttr($value) { if(empty($value)) return $value; $ali_oss_bindurl = config('app.ali_oss_bindurl'); $str = explode(',',$value); $array = []; foreach($str as $v){ $array[] = 'https://' . $ali_oss_bindurl .'/'. $v; } return $array; } public function getMediaIdAttr($value) { if (empty($value)) return ''; $arr = explode(',', $value); return $arr; } public function getWeixinMediaAttr($value) { if (empty($value)) return ''; $arr = explode(',', $value); return $arr; } }