Member.php 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. use Prettus\Repository\Contracts\Transformable;
  5. use Prettus\Repository\Traits\TransformableTrait;
  6. /**
  7. * Class Member.
  8. *
  9. * @package namespace App\Models;
  10. * @property int $id
  11. * @property string $phone 手机号码
  12. * @property string $nickname 昵称
  13. * @property string $password 登录密码
  14. * @property string $pay_pass 支付密码
  15. * @property string $encrypt 加密字符串
  16. * @property int $status 状态,0:关闭,1:开启
  17. * @property \Illuminate\Support\Carbon|null $created_at
  18. * @property \Illuminate\Support\Carbon|null $updated_at
  19. * @method static \Illuminate\Database\Eloquent\Builder|Member newModelQuery()
  20. * @method static \Illuminate\Database\Eloquent\Builder|Member newQuery()
  21. * @method static \Illuminate\Database\Eloquent\Builder|Member query()
  22. * @method static \Illuminate\Database\Eloquent\Builder|Member whereCreatedAt($value)
  23. * @method static \Illuminate\Database\Eloquent\Builder|Member whereEncrypt($value)
  24. * @method static \Illuminate\Database\Eloquent\Builder|Member whereId($value)
  25. * @method static \Illuminate\Database\Eloquent\Builder|Member whereNickname($value)
  26. * @method static \Illuminate\Database\Eloquent\Builder|Member wherePassword($value)
  27. * @method static \Illuminate\Database\Eloquent\Builder|Member wherePayPass($value)
  28. * @method static \Illuminate\Database\Eloquent\Builder|Member wherePhone($value)
  29. * @method static \Illuminate\Database\Eloquent\Builder|Member whereStatus($value)
  30. * @method static \Illuminate\Database\Eloquent\Builder|Member whereUpdatedAt($value)
  31. * @mixin \Eloquent
  32. * @property int $recom_id 推荐人ID
  33. * @property string|null $head_img 头像
  34. * @method static \Illuminate\Database\Eloquent\Builder|Member whereHeadImg($value)
  35. * @method static \Illuminate\Database\Eloquent\Builder|Member whereRecomId($value)
  36. * @property string $invite_code 推荐码
  37. * @property int $level_id 等级ID
  38. * @property string|null $token_str token
  39. * @method static \Illuminate\Database\Eloquent\Builder|Member whereInviteCode($value)
  40. * @method static \Illuminate\Database\Eloquent\Builder|Member whereLevelId($value)
  41. * @method static \Illuminate\Database\Eloquent\Builder|Member whereTokenStr($value)
  42. * @property string|null $consume_money 消费金
  43. * @property string|null $money 余额
  44. * @method static \Illuminate\Database\Eloquent\Builder|Member whereConsumeMoney($value)
  45. * @method static \Illuminate\Database\Eloquent\Builder|Member whereMoney($value)
  46. * @property string|null $benefit_money 公益豆
  47. * @method static \Illuminate\Database\Eloquent\Builder|Member whereBenefitMoney($value)
  48. * @property string|null $share_img 分享海报图片
  49. * @property int|null $sex 性别
  50. * @property string|null $code_img 推荐码
  51. * @method static \Illuminate\Database\Eloquent\Builder|Member whereCodeImg($value)
  52. * @method static \Illuminate\Database\Eloquent\Builder|Member whereSex($value)
  53. * @method static \Illuminate\Database\Eloquent\Builder|Member whereShareImg($value)
  54. * @property-read Member|null $recomMember
  55. * @property string|null $describe 描述
  56. * @property string|null $sid 长链接登陆编号
  57. * @property int|null $on_line 长链接在线
  58. * @property int|null $source 来源 1微信 2支付宝 3浏览器
  59. * @property int|null $is_del 是否删除 0否 1是
  60. * @property string|null $merge_source 账户合并了那些来源账户
  61. * @method static \Illuminate\Database\Eloquent\Builder|Member whereDescribe($value)
  62. * @method static \Illuminate\Database\Eloquent\Builder|Member whereIsDel($value)
  63. * @method static \Illuminate\Database\Eloquent\Builder|Member whereMergeSource($value)
  64. * @method static \Illuminate\Database\Eloquent\Builder|Member whereOnLine($value)
  65. * @method static \Illuminate\Database\Eloquent\Builder|Member whereSid($value)
  66. * @method static \Illuminate\Database\Eloquent\Builder|Member whereSource($value)
  67. * @property string $address 手机号码
  68. * @property string $recom_mobile 推荐人手机号码
  69. * @property string|null $remember_token
  70. * @property string|null $err_msg 锁定说明
  71. * @property string|null $m_p
  72. * @property string|null $m_p_p
  73. * @property int|null $is_lock 是否锁定,1:是,0否
  74. * @property string|null $total_money 累计总金额
  75. * @method static \Illuminate\Database\Eloquent\Builder|Member whereAddress($value)
  76. * @method static \Illuminate\Database\Eloquent\Builder|Member whereErrMsg($value)
  77. * @method static \Illuminate\Database\Eloquent\Builder|Member whereIsLock($value)
  78. * @method static \Illuminate\Database\Eloquent\Builder|Member whereMP($value)
  79. * @method static \Illuminate\Database\Eloquent\Builder|Member whereMPP($value)
  80. * @method static \Illuminate\Database\Eloquent\Builder|Member whereRecomMobile($value)
  81. * @method static \Illuminate\Database\Eloquent\Builder|Member whereRememberToken($value)
  82. * @method static \Illuminate\Database\Eloquent\Builder|Member whereTotalMoney($value)
  83. * @property int|null $m_id 客户端ID
  84. * @method static \Illuminate\Database\Eloquent\Builder|Member whereMId($value)
  85. */
  86. class Member extends Model implements Transformable
  87. {
  88. use TransformableTrait;
  89. /**
  90. * The attributes that are mass assignable.
  91. *
  92. * @var array
  93. */
  94. protected $guarded = ['id', 'updated_at', 'created_at'];
  95. // protected $dispatchesEvents=[
  96. // //绑定上下级关系
  97. // 'created'=>RelevanceEvent::class
  98. // ];
  99. /**
  100. * 定义一级分类关联模型
  101. * @return \Illuminate\Database\Eloquent\Relations\HasOne
  102. */
  103. public function recomMember()
  104. {
  105. return $this->hasOne('App\Models\Member', 'id', 'recom_id')->select(['id', 'nickname','phone']);
  106. }
  107. }