belongsToMany('App\Models\UserInfoModel','user_care_user','user_id','other_user_id'); } // 系统消息 public function systemInfo() { return $this->belongsToMany('App\Models\UserInfoModel','system_info','other_id','user_id')->withPivot('coin'); } //用户梦想 public function UserDream() { return $this->belongsToMany('App\Models\DreamInfoModel','user_dream','user_id','dream_id'); } //支持的梦想 public function supDream() { return $this->belongsToMany('App\Models\DreamInfoModel','system_info','user_id','other_id'); } //评论的梦想 public function comDream() { return $this->belongsToMany('App\Models\DreamInfoModel','comments_info','user_id','dream_id')->withPivot('content', 'level','created_at'); } //关注的用户 public function myCareNum() { return $this->hasMany('App\Models\UserCareUser','user_id','id'); } //关注我的用户 public function myFens() { return $this->hasMany('App\Models\UserCareUser','other_user_id','id'); } // 我的收藏 public function myCollection() { return $this->hasMany('App\Models\UserCareDream','user_id','id'); } // 回复的梦想 public function replyDream() { return $this->belongsToMany('App\Models\CommentInfoModel','reply_comments_info','user_id','comment_id')->withPivot('content', 'level','created_at'); } }