add role route override and user data scope

This commit is contained in:
2026-03-09 14:14:21 +08:00
parent ac640cc813
commit 679463d2c1
4 changed files with 161 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
<?php
declare(strict_types=1);
namespace App\Model;
use Hyperf\Database\Model\Relations\BelongsTo;
use Hyperf\DbConnection\Model\Model;
/**
* @property int $id
* @property int $user_id
* @property string $scope_type
* @property int $scope_id
* @property \Carbon\Carbon $created_at
*/
class UserDataScope extends Model
{
protected ?string $table = 'user_data_scopes';
public bool $timestamps = false;
protected array $fillable = [
'user_id',
'scope_type',
'scope_id',
];
protected array $casts = [
'id' => 'integer',
'user_id' => 'integer',
'scope_id' => 'integer',
'created_at' => 'datetime',
];
/**
* 所属用户
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class, 'user_id');
}
}