User.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <?php
  2. namespace biz\user\models;
  3. use biz\base\models\Base;
  4. /**
  5. * This is the model class for table "xhUser".
  6. *
  7. * @property int $id
  8. * @property string $mobile 手机号
  9. * @property string $avatar 头像
  10. * @property string $userName 用户的名称,昵称,显示的名字
  11. * @property string $realName 真实姓名
  12. * @property int $sex 性别 0未知 1男性2女性
  13. * @property string $birthday
  14. * @property string $password 密码
  15. * @property string $payPassword 支付密码
  16. * @property string $openId 微信openid
  17. * @property string $unionId 微信同一个开放平台下(网站应用,公众号等)用户唯一标识
  18. * @property string $alipayId 支付宝id
  19. * @property int $isFull 用户信息是否完整 0完整 1不完整,通过扫码付款生成的用户有不完整的情况
  20. * @property int $merchantId 商户id
  21. * @property int $isMember 是否会员
  22. * @property int $isStudent 是否学员
  23. * @property int $subscribe 是否关注平台 0未关注 1关注
  24. * @property int $hasSubscribe 关注历史 0没有关注过公众号 1有关注过
  25. * @property string $tag 标签id列表
  26. * @property string $province 省
  27. * @property string $city 市
  28. * @property string $dist 区县
  29. * @property string $address 详细街道地址
  30. * @property string $addLat 纬度
  31. * @property string $addLong 经度
  32. * @property string $addPrecision 精度
  33. * @property int $status 帐户状态 0正常 1冻结
  34. * @property string $remark 商家对用户的备注信息
  35. * @property string $createTime 创建时间
  36. * @property string $updateTime
  37. * @property int $subscribeTime 关注时间
  38. */
  39. class User extends Base
  40. {
  41. /**
  42. * @inheritdoc
  43. */
  44. public static function tableName()
  45. {
  46. return 'xhUser';
  47. }
  48. /**
  49. * @inheritdoc
  50. */
  51. public function rules()
  52. {
  53. return [
  54. [['sex', 'isFull', 'merchantId', 'isMember', 'identity', 'subscribe', 'hasSubscribe', 'status', 'subscribeTime','addTime'], 'integer'],
  55. [['birthday', 'createTime', 'updateTime'], 'safe'],
  56. [['createTime'], 'required'],
  57. [['mobile'], 'string', 'max' => 15],
  58. [['avatar'], 'string', 'max' => 200],
  59. [['userName', 'realName', 'alipayId'], 'string', 'max' => 50],
  60. [['password', 'payPassword'], 'string', 'max' => 64],
  61. [['openId', 'unionId'], 'string', 'max' => 100],
  62. [['tag'], 'string', 'max' => 500],
  63. [['province', 'city', 'dist', 'address', 'addLat', 'addLong', 'addPrecision'], 'string', 'max' => 20],
  64. [['remark'], 'string', 'max' => 1000],
  65. [['openId'], 'unique'],
  66. ];
  67. }
  68. /**
  69. * @inheritdoc
  70. */
  71. public function attributeLabels()
  72. {
  73. return [
  74. 'id' => 'ID',
  75. 'mobile' => 'Mobile',
  76. 'avatar' => 'Avatar',
  77. 'userName' => 'User Name',
  78. 'realName' => 'Real Name',
  79. 'sex' => 'Sex',
  80. 'birthday' => 'Birthday',
  81. 'password' => 'Password',
  82. 'payPassword' => 'Pay Password',
  83. 'openId' => 'Open ID',
  84. 'unionId' => 'Union ID',
  85. 'alipayId' => 'Alipay ID',
  86. 'isFull' => 'Is Full',
  87. 'merchantId' => 'Merchant ID',
  88. 'isMember' => 'Is Member',
  89. 'identity' => 'identity',
  90. 'subscribe' => 'Subscribe',
  91. 'hasSubscribe' => 'Subscribe History',
  92. 'tag' => 'Tag',
  93. 'province' => 'Province',
  94. 'city' => 'City',
  95. 'dist' => 'Dist',
  96. 'address' => 'Address',
  97. 'addLat' => 'Add Lat',
  98. 'addLong' => 'Add Long',
  99. 'addPrecision' => 'Add Precision',
  100. 'status' => 'Status',
  101. 'addTime' => 'addTime',
  102. 'remark' => 'remark',
  103. 'createTime' => 'Create Time',
  104. 'updateTime' => 'Update Time',
  105. 'subscribeTime' => 'Subscribe Time',
  106. ];
  107. }
  108. }