Suggest.php 972 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. public function OrderPatient()
  28. {
  29. return $this->hasOne(OrderPatient::class,'order_id','order_id');
  30. }
  31. /**
  32. * 意见详情表联查
  33. * @return mixed
  34. */
  35. public function details()
  36. {
  37. return $this->hasMany(SuggestDetail::class,'suggest_id','id');
  38. }
  39. /**
  40. * 获取用户信息
  41. * @return mixed
  42. */
  43. public function user()
  44. {
  45. return $this->hasOne(User::class,'id','user_id');
  46. }
  47. }