Auth.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?php
  2. namespace common\models\member;
  3. use Yii;
  4. use common\enums\StatusEnum;
  5. use common\traits\HasOneMember;
  6. /**
  7. * This is the model class for table "{{%member_auth}}".
  8. *
  9. * @property int $id 主键
  10. * @property int|null $merchant_id 商户id
  11. * @property int|null $member_id 用户id
  12. * @property int|null $member_type 1:会员;2:后台管理员;3:商家管理员
  13. * @property string|null $unionid 唯一ID
  14. * @property string|null $oauth_client 授权组别
  15. * @property string|null $oauth_client_user_id 授权id
  16. * @property int|null $gender 性别[0:未知;1:男;2:女]
  17. * @property string|null $nickname 昵称
  18. * @property string|null $head_portrait 头像
  19. * @property string|null $birthday 生日
  20. * @property string|null $country 国家
  21. * @property string|null $province 省
  22. * @property string|null $city 市
  23. * @property int|null $is_addon 是否插件
  24. * @property string|null $addon_name 插件名称
  25. * @property int|null $status 状态(-1:已删除,0:禁用,1:正常)
  26. * @property int|null $created_at 创建时间
  27. * @property int|null $updated_at 修改时间
  28. * @property $member Member
  29. */
  30. class Auth extends \common\models\base\BaseModel
  31. {
  32. use HasOneMember;
  33. /**
  34. * {@inheritdoc}
  35. */
  36. public static function tableName()
  37. {
  38. return '{{%member_auth}}';
  39. }
  40. /**
  41. * {@inheritdoc}
  42. */
  43. public function rules()
  44. {
  45. return [
  46. [['merchant_id', 'member_id', 'member_type', 'gender', 'is_addon', 'status', 'created_at', 'updated_at'], 'integer'],
  47. [['birthday'], 'safe'],
  48. [['unionid'], 'string', 'max' => 64],
  49. [['oauth_client'], 'string', 'max' => 20],
  50. [['oauth_client_user_id', 'nickname', 'country', 'province', 'city'], 'string', 'max' => 100],
  51. [['head_portrait', 'addon_name'], 'string', 'max' => 200],
  52. ];
  53. }
  54. /**
  55. * {@inheritdoc}
  56. */
  57. public function attributeLabels()
  58. {
  59. return [
  60. 'id' => '主键',
  61. 'merchant_id' => '商户id',
  62. 'member_id' => '用户id',
  63. 'member_type' => '1:会员;2:后台管理员;3:商家管理员',
  64. 'unionid' => '唯一ID',
  65. 'oauth_client' => '授权组别',
  66. 'oauth_client_user_id' => '授权ID',
  67. 'gender' => '性别',
  68. 'nickname' => '昵称',
  69. 'head_portrait' => '头像',
  70. 'birthday' => '生日',
  71. 'country' => '国家',
  72. 'province' => '省',
  73. 'city' => '市',
  74. 'is_addon' => '是否插件',
  75. 'addon_name' => '插件名称',
  76. 'status' => '状态',
  77. 'created_at' => '创建时间',
  78. 'updated_at' => '修改时间',
  79. ];
  80. }
  81. }
粤ICP备19079148号