mirror of
https://github.com/ProxyPanel/ProxyPanel.git
synced 2026-04-11 23:19:05 +00:00
1. 框架更新至5.8,并且其涉及代码进行修改; 2. 对支付的alipay组件针对php7.2/3进行修改; 3. 重构了节点信息获取逻辑;现在为实时请求; 4. 代码小细节和命名规范
50 lines
1.4 KiB
PHP
50 lines
1.4 KiB
PHP
<?php
|
||
|
||
namespace App\Http\Models;
|
||
|
||
use Eloquent;
|
||
use Illuminate\Database\Eloquent\Builder;
|
||
use Illuminate\Database\Eloquent\Model;
|
||
use Illuminate\Support\Carbon;
|
||
|
||
/**
|
||
* SS节点在线IP信息
|
||
* Class SsNodeIp
|
||
*
|
||
* @package App\Http\Models
|
||
* @mixin Eloquent
|
||
* @property int $id
|
||
* @property int $node_id 节点ID
|
||
* @property int $user_id 用户ID
|
||
* @property int $port 端口
|
||
* @property string $type 类型:all、tcp、udp
|
||
* @property string|null $ip 连接IP:每个IP用,号隔开
|
||
* @property Carbon $created_at 上报时间
|
||
* @property-read SsNode $node
|
||
* @property-read User $user
|
||
* @method static Builder|SsNodeIp newModelQuery()
|
||
* @method static Builder|SsNodeIp newQuery()
|
||
* @method static Builder|SsNodeIp query()
|
||
* @method static Builder|SsNodeIp whereCreatedAt($value)
|
||
* @method static Builder|SsNodeIp whereId($value)
|
||
* @method static Builder|SsNodeIp whereIp($value)
|
||
* @method static Builder|SsNodeIp whereNodeId($value)
|
||
* @method static Builder|SsNodeIp wherePort($value)
|
||
* @method static Builder|SsNodeIp whereType($value)
|
||
* @method static Builder|SsNodeIp whereUserId($value)
|
||
*/
|
||
class SsNodeIp extends Model
|
||
{
|
||
protected $table = 'ss_node_ip';
|
||
protected $primaryKey = 'id';
|
||
|
||
function node()
|
||
{
|
||
return $this->belongsTo(SsNode::class, 'node_id', 'id');
|
||
}
|
||
|
||
function user()
|
||
{
|
||
return $this->belongsTo(User::class, 'port', 'port');
|
||
}
|
||
} |