You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yanzong/app/common/model/invite/InviteLog.php

44 lines
834 B

<?php
declare (strict_types=1);
namespace app\common\model\invite;
use app\common\model\User;
use cores\BaseModel;
use think\model\relation\HasOne;
/**
* 邀请记录表
*
* This class represents the invite log entity.
* It extends the BaseModel class.
*/
class InviteLog extends BaseModel
{
// 定义表名
protected $name = 'invite_log';
// 定义主键
protected $pk = 'invite_id';
public function user(): HasOne
{
return $this->hasOne(User::class, 'user_id', 'user_id');
}
public function invitee(): HasOne
{
return $this->hasOne(User::class, 'user_id', 'invitee_user_id');
}
/**
* 详情
* @param array $where
* @return static|array|null
*/
public static function detail(array $where)
{
return self::get($where);
}
}