Docter.php 671 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: zilongs
  5. * Date: 20-9-29
  6. * Time: 上午11:12
  7. */
  8. namespace App\Models;
  9. class Docter extends BaseModel
  10. {
  11. protected $casts = [
  12. 'label' => 'json',
  13. ];
  14. public function office()
  15. {
  16. return $this->belongsTo(Office::class)->select(['id', 'name']);
  17. }
  18. public function qualification()
  19. {
  20. return $this->belongsTo(Qualification::class)->select(['id', 'name']);
  21. }
  22. public function organization()
  23. {
  24. return $this->belongsToMany(Organization::class);
  25. }
  26. public function evaluate()
  27. {
  28. return $this->hasMany(Evaluate::class)->where('status', 2);
  29. }
  30. }