提交代码
This commit is contained in:
30
app/Models/UserRelationLog.php
Normal file
30
app/Models/UserRelationLog.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\User;
|
||||
use RuLong\Panel\Models\Admin;
|
||||
|
||||
class UserRelationLog extends Model
|
||||
{
|
||||
protected $guarded = [];
|
||||
|
||||
public function beforuser()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'before_id', 'id');
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(config('user_relation.user_model'));
|
||||
}
|
||||
|
||||
public function parent()
|
||||
{
|
||||
return $this->belongsTo(config('user_relation.user_model'), 'parent_id')->withDefault();
|
||||
}
|
||||
public function operator()
|
||||
{
|
||||
return $this->belongsTo(Admin::class, 'operator_id')->withDefault();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user