love_php/app/Models/UserProfile.php

56 lines
1.3 KiB
PHP
Raw Permalink Normal View History

2026-04-02 09:20:51 +08:00
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use App\Models\Base;
class UserProfile extends Base
{
protected $table = "user_profiles";
public function goodMatch()
{
return $this->hasOne(GoodMatch::class, 'user_id', 'id');
}
public function matchmakerClient()
{
return $this->hasOne(MatchmakerClient::class, 'client_user_id', 'id');
}
public function wechat()
{
return $this->hasONe(Wechat::class, 'user_id', 'id');
}
public function fromWechat()
{
return $this->hasOne(Wechat::class, 'openid', 'from_openid');
}
public function profileCourtship()
{
return $this->hasOne(ProfileCourtship::class, 'user_id', 'id');
}
public function profileMarriage()
{
return $this->hasOne(ProfileMarriage::class, 'user_id', 'id');
}
public function service()
{
return $this->hasOne(ServiceClient::class, 'client_user_id', 'id');
}
public function clientComments()
{
return $this->hasOne(ClientComment::class, 'user_id', 'id');
}
public function user()
{
return $this->hasOne(User::class, 'id', 'id');
}
public function communityMember()
{
return $this->hasOne(CommunityMember::class, 'user_id', 'id');
}
}