Serviceapplys.php 918 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. class Serviceapplys extends Model
  5. {
  6. //
  7. protected $table = 'service_applys';
  8. protected $fillable = ['docter_id'];
  9. public function docter(){
  10. return $this->belongsTo(Docter::class);
  11. }
  12. public function ondocter()
  13. {
  14. return $this->hasOne(Docter::class,'id','docter_id');
  15. }
  16. public function docterorganization()
  17. {
  18. return $this->hasMany(DocterOrganization::class,'docter_id','docter_id');
  19. }
  20. public function organization()
  21. {
  22. return $this->belongsToMany('App\Models\Organization','docter_organization','docter_id','id');
  23. }
  24. // private static $_post_type =[
  25. // 1 => '图文',
  26. // 2 => '电话',
  27. // 3 => '问诊'
  28. // ];
  29. // private static $_post_status =[
  30. // 1 => '审核',
  31. // 2 => '通过',
  32. // 3 => '未通过'
  33. // ];
  34. }