Invite.php 556 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace App\Http\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. /**
  5. * 邀请码
  6. * Class Invite
  7. * @package App\Http\Models
  8. */
  9. class Invite extends Model
  10. {
  11. protected $table = 'invite';
  12. protected $primaryKey = 'id';
  13. protected $fillable = [
  14. 'uid',
  15. 'fuid',
  16. 'code',
  17. 'status',
  18. 'dateline'
  19. ];
  20. public function Generator()
  21. {
  22. return $this->hasOne(User::class, 'id', 'uid');
  23. }
  24. public function User()
  25. {
  26. return $this->hasOne(User::class, 'id', 'fuid');
  27. }
  28. }