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.

28 lines
477 B

8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
  1. <?php
  2. namespace App\Http\Model;
  3. use Illuminate\Database\Eloquent\Model;
  4. use App\Common\Token;
  5. class User extends BaseModel
  6. {
  7. //用户模型
  8. protected $table = 'user';
  9. public $timestamps = false;
  10. /**
  11. * 不能被批量赋值的属性
  12. *
  13. * @var array
  14. */
  15. protected $guarded = [];
  16. /**
  17. * 获取关联到用户的角色
  18. */
  19. public function userrole()
  20. {
  21. return $this->belongsTo(UserRole::class, 'role_id', 'id');
  22. }
  23. }