SystemUser.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. namespace app\model\system;
  3. use app\extra\basic\Model;
  4. use app\model\hx\HxAgent;
  5. use think\model\relation\HasOne;
  6. /**
  7. * @property integer $id (主键)
  8. * @property integer $user_id
  9. * @property integer $role_id 权限ID
  10. * @property string $role_path
  11. * @property integer $parent_id 代理ID
  12. * @property integer $account_id 店铺id
  13. * @property string $username 用户名
  14. * @property string $truename 真实姓名
  15. * @property string $password 密码
  16. * @property mixed $salt 密钥串
  17. * @property integer $status 状态
  18. * @property string $contact_name
  19. * @property string $contact_mobile
  20. * @property integer $type 1管理员2代理子账号3店铺账号
  21. * @property integer $is_deleted 删除状态
  22. * @property integer $is_super
  23. * @property string $remark 备注
  24. * @property string $login_ip 登录IP
  25. * @property mixed $login_at 登录时间
  26. * @property integer $login_num
  27. * @property string $create_ip
  28. * @property mixed $updated_at 更新时间
  29. * @property mixed $create_at 创建时间
  30. */
  31. class SystemUser extends Model
  32. {
  33. /**
  34. * The connection name for the model.
  35. *
  36. * @var string|null
  37. */
  38. protected $connection = 'mysql';
  39. /**
  40. * The table associated with the model.
  41. *
  42. * @var string
  43. */
  44. protected string $table = "system_user";
  45. /**
  46. * The primary key associated with the table.
  47. *
  48. * @var string
  49. */
  50. protected string $primaryKey = "id";
  51. /**
  52. * Indicates if the model should be timestamped.
  53. *
  54. * @var bool
  55. */
  56. public bool $timestamps = false;
  57. public function agent(): HasOne
  58. {
  59. return $this->hasOne(HxAgent::class,"agent_id","agent_id");
  60. }
  61. }