Team.php 787 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: zilongs
  5. * Date: 20-10-4
  6. * Time: 下午10:09
  7. */
  8. namespace App\Models;
  9. class Team extends BaseModel
  10. {
  11. public function getTagsAttribute($value)
  12. {
  13. return explode(',', $value);
  14. }
  15. public function setMemberAttribute($value)
  16. {
  17. $this->attributes['member'] = implode(',', $value);
  18. }
  19. public function TeamDocter()
  20. {
  21. return $this->belongsTo(TeamDocter::class,'team_id','id');
  22. }
  23. public function docter()
  24. {
  25. return $this->belongsToMany(Docter::class, 'team_docters');
  26. }
  27. public function DocterOrganization(){
  28. return $this->belongsTo(DocterOrganization::class);
  29. }
  30. public function servicepack(){
  31. return $this->belongsTo(ServicePack::class);
  32. }
  33. }