mirror of
https://github.com/ProxyPanel/ProxyPanel.git
synced 2026-04-11 15:10:54 +00:00
1. 框架更新至5.8,并且其涉及代码进行修改; 2. 对支付的alipay组件针对php7.2/3进行修改; 3. 重构了节点信息获取逻辑;现在为实时请求; 4. 代码小细节和命名规范
56 lines
1.6 KiB
PHP
56 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Models;
|
|
|
|
use Eloquent;
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* 用户流量记录
|
|
* Class UserTrafficLog
|
|
*
|
|
* @package App\Http\Models
|
|
* @mixin Eloquent
|
|
* @property int $id
|
|
* @property int $user_id 用户ID
|
|
* @property int $u 上传流量
|
|
* @property int $d 下载流量
|
|
* @property int $node_id 节点ID
|
|
* @property float $rate 流量比例
|
|
* @property string $traffic 产生流量
|
|
* @property int $log_time 记录时间
|
|
* @property-read SsNode $node
|
|
* @property-read User $user
|
|
* @method static Builder|UserTrafficLog newModelQuery()
|
|
* @method static Builder|UserTrafficLog newQuery()
|
|
* @method static Builder|UserTrafficLog query()
|
|
* @method static Builder|UserTrafficLog whereD($value)
|
|
* @method static Builder|UserTrafficLog whereId($value)
|
|
* @method static Builder|UserTrafficLog whereLogTime($value)
|
|
* @method static Builder|UserTrafficLog whereNodeId($value)
|
|
* @method static Builder|UserTrafficLog whereRate($value)
|
|
* @method static Builder|UserTrafficLog whereTraffic($value)
|
|
* @method static Builder|UserTrafficLog whereU($value)
|
|
* @method static Builder|UserTrafficLog whereUserId($value)
|
|
*/
|
|
class UserTrafficLog extends Model
|
|
{
|
|
public $timestamps = FALSE;
|
|
protected $table = 'user_traffic_log';
|
|
protected $primaryKey = 'id';
|
|
|
|
// 关联账号
|
|
|
|
function user()
|
|
{
|
|
return $this->belongsTo(User::class, 'user_id', 'id');
|
|
}
|
|
|
|
// 关联节点
|
|
function node()
|
|
{
|
|
return $this->belongsTo(SsNode::class, 'node_id', 'id');
|
|
}
|
|
|
|
} |