Files
ProxyPanel/app/Http/Models/UserTrafficModifyLog.php
兔姬桑 a0922521cf 初始化
2020-08-05 03:19:28 +08:00

41 lines
790 B
PHP

<?php
namespace App\Http\Models;
use Illuminate\Database\Eloquent\Model;
/**
* 用户流量变动记录
* Class UserTrafficModifyLog
*
* @package App\Http\Models
* @mixin \Eloquent
*/
class UserTrafficModifyLog extends Model
{
protected $table = 'user_traffic_modify_log';
protected $primaryKey = 'id';
// 关联账号
function user()
{
return $this->hasOne(User::class, 'id', 'user_id');
}
// 关联订单
function order()
{
return $this->hasOne(Order::class, 'oid', 'order_id');
}
function getBeforeAttribute($value)
{
return $this->attributes['before'] = flowAutoShow($value);
}
function getAfterAttribute($value)
{
return $this->attributes['after'] = flowAutoShow($value);
}
}