mirror of
https://github.com/ProxyPanel/ProxyPanel.git
synced 2026-04-11 23:19:05 +00:00
39 lines
782 B
PHP
39 lines
782 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\HasOneThrough;
|
|
|
|
/**
|
|
* 用户订阅地址请求日志
|
|
*/
|
|
class UserSubscribeLog extends Model
|
|
{
|
|
|
|
public const CREATED_AT = 'request_time';
|
|
|
|
public const UPDATED_AT = null;
|
|
|
|
protected $table = 'user_subscribe_log';
|
|
|
|
public function subscribe(): BelongsTo
|
|
{
|
|
return $this->belongsTo(UserSubscribe::class, 'user_subscribe_id');
|
|
}
|
|
|
|
public function user(): HasOneThrough
|
|
{
|
|
return $this->hasOneThrough(
|
|
User::class,
|
|
UserSubscribe::class,
|
|
'id',
|
|
'id',
|
|
'user_subscribe_id',
|
|
'user_id'
|
|
);
|
|
}
|
|
|
|
}
|