hasOne(ParticipantRedPacket::class, 'participant_id'); } public function participant_helper() { return $this->hasOne(FruitHistory::class, 'participant_helper_id'); } public function participant_share(){ return $this->hasOne(FruitHistory::class,'participant_id'); } //修改器 public function getNicknameAttribute($value) { if($value == ''){ return "匿名用户"; } return $value; } // public function getAvatarAttribute($value) // { // if($value = ''){ // return ""; // } // return $value; // } }