You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

27 lines
451 B

<?php
namespace App\Http\Model;
use Illuminate\Database\Eloquent\Model;
class User extends Model
{
//用户模型
protected $table = 'user';
public $timestamps = false;
/**
* 不能被批量赋值的属性
*
* @var array
*/
protected $guarded = [];
/**
* 获取关联到用户的角色
*/
public function userrole()
{
return $this->belongsTo(UserRole::class, 'role_id', 'id');
}
}