Suggest.php 853 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: zilongs
  5. * Date: 20-10-5
  6. * Time: 上午11:31
  7. */
  8. namespace App\Models;
  9. class Suggest extends BaseModel
  10. {
  11. public function order()
  12. {
  13. return $this->belongsTo(Order::class);
  14. }
  15. public function suggestsDetail()
  16. {
  17. return $this->hasMany(SuggestsDetail::class);
  18. }
  19. /**
  20. * 患者表联查
  21. * @return mixed
  22. */
  23. public function Patient()
  24. {
  25. return $this->hasOne(Patient::class,'id','patient_id');
  26. }
  27. /**
  28. * 意见详情表联查
  29. * @return mixed
  30. */
  31. public function details()
  32. {
  33. return $this->hasMany(SuggestDetail::class,'suggest_id','id');
  34. }
  35. /**
  36. * 获取用户信息
  37. * @return mixed
  38. */
  39. public function user()
  40. {
  41. return $this->hasOne(User::class,'id','user_id');
  42. }
  43. }